Last active
December 19, 2024 09:21
-
-
Save fwsGonzo/9132f0ef7d3f009baa5b222eedf392da to your computer and use it in GitHub Desktop.
Benchmark between libriscv and LuaJIT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./bench | |
* All benchmark results are measured in 200x1200 samples | |
benchmark overhead median 0ns lowest: 0ns highest: 0ns | |
Self-test running ELF entry at 0x1020C | |
Calling into event loop...! | |
event_loop: Checking for work | |
event_loop: Going to sleep! | |
add_work: Adding work | |
Resuming event loop...! | |
event_loop: Checking for work | |
work: Doing some work! | |
event_loop: Going to sleep! | |
event_loop: Checking for work | |
event_loop: Going to sleep! | |
add_work: Adding work | |
event_loop: Checking for work | |
work: Doing some work! | |
event_loop: Going to sleep! | |
RISC-V self-test OK | |
* Loading program of size 14772 from 0x5fdf5935c9c0 to virtual 0x10000 -> 0x139b4 | |
* Program segment readable: 1 writable: 0 executable: 1 | |
* Loading program of size 36 from 0x5fdf59360374 to virtual 0x149b4 -> 0x149d8 | |
* Program segment readable: 1 writable: 1 executable: 0 | |
* Using program-provided exit function at 0x12dbc | |
libriscv: Found embedded translation for hash 46CFA72F, 3/380 mappings | |
* Entry is at 0x1020c | |
libriscv: mips instr 0, time 0.060292, 0.000000 mip/s | |
libriscv: call overhead median 3ns lowest: 3ns highest: 6ns | |
libriscv: call args=1 median 7ns lowest: 7ns highest: 16ns | |
libriscv: call args=2 median 7ns lowest: 7ns highest: 24ns | |
libriscv: call args=3 median 7ns lowest: 7ns highest: 32ns | |
libriscv: call args=4 median 7ns lowest: 7ns highest: 15ns | |
libriscv: call args=5 median 7ns lowest: 7ns highest: 10ns | |
libriscv: call args=6 median 7ns lowest: 7ns highest: 10ns | |
libriscv: call args=7 median 7ns lowest: 7ns highest: 23ns | |
libriscv: call args=8 median 7ns lowest: 7ns highest: 11ns | |
libriscv: timed call overhead median 214ns lowest: 213ns highest: 232ns | |
libriscv: preempt overhead median 17ns lowest: 11ns highest: 21ns | |
libriscv: fork median 235ns lowest: 228ns highest: 257ns | |
libriscv: resume execution median 4ns lowest: 4ns highest: 7ns | |
luajit: call overhead median 131ns lowest: 129ns highest: 147ns | |
luajit: call args=1 median 146ns lowest: 144ns highest: 171ns | |
luajit: call args=2 median 149ns lowest: 147ns highest: 165ns | |
luajit: call args=3 median 153ns lowest: 151ns highest: 171ns | |
luajit: call args=4 median 156ns lowest: 154ns highest: 169ns | |
luajit: call args=5 median 159ns lowest: 158ns highest: 178ns | |
luajit: call args=6 median 163ns lowest: 161ns highest: 181ns | |
luajit: call args=7 median 166ns lowest: 164ns highest: 182ns | |
luajit: call args=8 median 170ns lowest: 168ns highest: 186ns | |
libriscv: syscall args=0 median 8ns lowest: 8ns highest: 11ns | |
libriscv: syscall args=1 median 8ns lowest: 8ns highest: 35ns | |
libriscv: syscall args=2 median 8ns lowest: 8ns highest: 9ns | |
libriscv: syscall args=3 median 8ns lowest: 8ns highest: 23ns | |
libriscv: syscall args=4 median 8ns lowest: 8ns highest: 9ns | |
libriscv: syscall args=5 median 8ns lowest: 8ns highest: 30ns | |
libriscv: syscall args=6 median 8ns lowest: 8ns highest: 9ns | |
libriscv: syscall args=7 median 8ns lowest: 8ns highest: 11ns | |
libriscv: syscall string median 10ns lowest: 9ns highest: 12ns | |
luajit: syscall args=0 median 146ns lowest: 145ns highest: 163ns | |
luajit: syscall args=1 median 159ns lowest: 157ns highest: 180ns | |
luajit: syscall args=2 median 170ns lowest: 168ns highest: 185ns | |
luajit: syscall args=3 median 184ns lowest: 180ns highest: 200ns | |
luajit: syscall args=4 median 194ns lowest: 191ns highest: 216ns | |
luajit: syscall args=5 median 204ns lowest: 202ns highest: 216ns | |
luajit: syscall args=6 median 220ns lowest: 214ns highest: 235ns | |
luajit: syscall args=7 median 229ns lowest: 224ns highest: 247ns | |
luajit: syscall string median 161ns lowest: 159ns highest: 173ns | |
After this point, call overhead is subtracted from every benchmark result for both libriscv and Lua | |
libriscv: array append median 4ns lowest: 4ns highest: 12ns | |
libriscv: vector append median 5ns lowest: 5ns highest: 7ns | |
luajit: table append median 31ns lowest: 19ns highest: 53ns | |
libriscv: 8x arguments median 21ns lowest: 21ns highest: 47ns | |
libriscv: 8x stored args median 16ns lowest: 16ns highest: 41ns | |
libriscv: 8x prepared args median 20ns lowest: 20ns highest: 37ns | |
luajit: 8x arguments median 317ns lowest: 309ns highest: 349ns | |
libriscv: integer math median 5ns lowest: 5ns highest: 5ns | |
libriscv: fp math median 7ns lowest: 7ns highest: 8ns | |
libriscv: exp math median 9ns lowest: 9ns highest: 24ns | |
libriscv: fib(40) median 3ns lowest: 3ns highest: 24ns | |
libriscv: taylor(1K) median 664ns lowest: 635ns highest: 692ns | |
luajit: integer math median 42ns lowest: 38ns highest: 53ns | |
luajit: fp math median 52ns lowest: 51ns highest: 67ns | |
luajit: exp math median 57ns lowest: 56ns highest: 87ns | |
luajit: fib(40) median 53ns lowest: 51ns highest: 73ns | |
luajit: taylor(1K) median 943ns lowest: 889ns highest: 964ns | |
libriscv: complex syscall median 33ns lowest: 32ns highest: 71ns | |
luajit: complex syscall median 726ns lowest: 719ns highest: 791ns | |
libriscv: micro threads median 164ns lowest: 150ns highest: 197ns | |
luajit: coroutines median 166ns lowest: 160ns highest: 199ns | |
libriscv: micro thread args median 190ns lowest: 173ns highest: 231ns | |
libriscv: full thread args median 192ns lowest: 180ns highest: 209ns | |
luajit: coroutine args median 223ns lowest: 217ns highest: 243ns | |
luajit: coroutine args median 238ns lowest: 231ns highest: 261ns | |
libriscv: naive memcpy median 524ns lowest: 429ns highest: 627ns | |
libriscv: syscall memcpy median 13ns lowest: 13ns highest: 16ns | |
luajit: memcpy median 97ns lowest: 90ns highest: 129ns | |
libriscv: syscall memset median 9ns lowest: 8ns highest: 31ns | |
libriscv: naive memset median 57ns lowest: 56ns highest: 79ns | |
luajit: memset median 65ns lowest: 63ns highest: 202ns | |
libriscv: sieve(10M) median 38ms lowest: 38ms highest: 38ms | |
luajit: sieve(10M) median 130ms lowest: 130ms highest: 130ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
libriscv with TCC (as a form of JIT) against LuaJIT