diff --git a/README.md b/README.md index c28fe2cc..5febf094 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,14 @@ Performance results for cpython 3.9 are applicable to for pkpy. See https://pocketpy.dev/performance/ for details. +These are the results of the primes benchmark, which *roughly* reflects the performance among lua, cpython and pkpy. + +| name | version | time | file | +| ---- | ---- | ---- | ---- | +| lua | 5.3.3 | `1.576s ■■■■■■■■■□□□□□□□` | [benchmarks/primes.lua](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.lua) | +| pocketpy | 1.2.7 | `2.385s ■■■■■■■■■■■■■□□□` | [benchmarks/primes.py](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.py) | +| cpython | 3.8.10 | `2.871s ■■■■■■■■■■■■■■■■` | [benchmarks/primes.py](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.py) | + ## Used By | | Description | @@ -165,7 +173,7 @@ All kinds of contributions are welcome. - any suggestions - any questions -If you find pocketpy useful, consider star this repository (●'◡'●) +If you find pkpy useful, consider star this repository (●'◡'●) ## Sponsor me diff --git a/__hidden_xmake.lua b/__hidden_xmake.lua deleted file mode 100644 index e13fe97b..00000000 --- a/__hidden_xmake.lua +++ /dev/null @@ -1,49 +0,0 @@ -set_project("pocketpy") - -set_allowedplats("windows", "linux", "macosx", "wasm", "android") - -option("dev", {default = true, showmenu = true, description = ""}) - -includes("dylib") - -add_requires("python", {kind = "binary"}) - -add_rules("mode.debug", "mode.release") - -set_languages("c++17") - -add_cxflags("/utf-8", {tools = "cl"}) - -add_includedirs("include") - -if is_plat("linux", "macosx") then - add_syslinks("dl") -end - -target("pocketpy") - if has_config("dev") then - set_kind("shared") - else - set_kind("$(kind)") - end - - add_files("src/*.cpp") - add_headerfiles("include/(**.h)") - - if is_plat("windows") and is_kind("shared") then - add_rules("utils.symbols.export_all") - end - - before_build(function (target) - local python = assert(import("lib.detect.find_tool")("python3"), "python3 not found!") - os.execv(python.program, {"prebuild.py"}) - end) - -target("main") - set_kind("binary") - add_files("src2/main.cpp") - add_deps("pocketpy") - - on_load(function (target) - target:set("enabled", has_config("dev")) - end) diff --git a/docs/index.md b/docs/index.md index 7047f6bb..b8eb5d42 100644 --- a/docs/index.md +++ b/docs/index.md @@ -43,7 +43,7 @@ These platforms are officially tested. ## Star the repo -If you find pocketpy useful, consider [star this repository](https://github.com/blueloveth/pocketpy) (●'◡'●) +If you find pkpy useful, consider [star this repository](https://github.com/blueloveth/pocketpy) (●'◡'●) ## Sponsor me diff --git a/docs/performance.md b/docs/performance.md index e9dcf2d6..afea4871 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -126,4 +126,32 @@ Testing directory: benchmarks/ ALL TESTS PASSED ``` -See [actions/runs](https://github.com/blueloveTH/pocketpy/actions/runs/6511071423/job/17686074263). \ No newline at end of file +See [actions/runs](https://github.com/blueloveTH/pocketpy/actions/runs/6511071423/job/17686074263). + +## Primes benchmarks + +These are the results of the primes benchmark. + +| name | version | time | file | +| ---- | ---- | ---- | ---- | +| lua | 5.3.3 | `1.576s ■■■■■■■■■□□□□□□□` | [benchmarks/primes.lua](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.lua) | +| pocketpy | 1.2.7 | `2.385s ■■■■■■■■■■■■■□□□` | [benchmarks/primes.py](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.py) | +| cpython | 3.8.10 | `2.871s ■■■■■■■■■■■■■■■■` | [benchmarks/primes.py](https://github.com/blueloveTH/pocketpy/blob/3d332a694f99ae2d327e732e7f3e3215bedcb069/benchmarks/primes.py) | + +```sh +$ time lua benchmarks/primes.lua + +real 0m1.576s +user 0m1.514s +sys 0m0.060s +$ time ./main benchmarks/primes.py + +real 0m2.385s +user 0m2.247s +sys 0m0.100s +$ time python benchmarks/primes.py + +real 0m2.871s +user 0m2.798s +sys 0m0.060s +``` \ No newline at end of file diff --git a/docs/unity/bindings.md b/docs/unity/bindings.md index 24da72f0..c09d96d1 100644 --- a/docs/unity/bindings.md +++ b/docs/unity/bindings.md @@ -182,4 +182,4 @@ delegate object NativeFuncC(VM vm, object[] args); + `CSharpLambda BindFunc(PyObject obj, string name, int argc, NativeFuncC f)` -It is similar to `bind_func` in [C++ API](../quick-start/bind/). +It is similar to `bind_func` in [C++ API](../bindings/).