📝 doc: benchmark results

main
_ 2023-10-01 02:00:23 -05:00
parent c50c16b9db
commit 4e9f9a74c5
3 changed files with 41 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/flamegraph.svg
/luac.out
/perf.data*
/target
/untracked

View File

@ -10,3 +10,12 @@ edition = "2021"
# blake3, used to hash test vectors
blake3 = "1.5.0"
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
# Recommended for flamegraph
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Clink-arg=-Wl,--no-rosegment"]
[profile.release]
# Recommended for profiling, e.g. flamegraph
debug = true

View File

@ -34,3 +34,33 @@
- [ ] Long strings
- [ ] Using arrays internally for tables
- [ ] Compiling Lua source code to bytecode
# Benchmark
9x slower than PUC Lua, 90x slower than LuaJIT.
Based only on the n-body simulation from the computer language benchmarks,
because it's easy to run.
```
time target/release/lunar_wave_vm --script test_vectors/n_body.lua -- 500000; time lua test_vectors/n_body.lua 500000; time luajit test_vectors/n_body.lua 500000;
-0.169075164
-0.169096567
[src/main.rs:110] x = []
real 0m10.543s
user 0m10.535s
sys 0m0.000s
-0.169075164
-0.169096567
real 0m1.173s
user 0m1.165s
sys 0m0.004s
-0.169075164
-0.169096567
real 0m0.117s
user 0m0.116s
sys 0m0.000s
```