Skip to content

Instantly share code, notes, and snippets.

@fwsGonzo
Last active December 31, 2023 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwsGonzo/9132f0ef7d3f009baa5b222eedf392da to your computer and use it in GitHub Desktop.
Save fwsGonzo/9132f0ef7d3f009baa5b222eedf392da to your computer and use it in GitHub Desktop.
Benchmark between libriscv and LuaJIT
$ ./bench
* All benchmark results are measured in 200x1200 samples
benchmark overhead median 0ns lowest: 0ns highest: 0ns
Self-test running ELF entry at 0x101BC
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
libriscv: mips instr 640010000, time 0.031781, 20138.136015 mip/s
libriscv: call overhead median 4ns lowest: 3ns highest: 4ns
libriscv: preempt overhead median 12ns lowest: 12ns highest: 20ns
libriscv: fork median 271ns lowest: 268ns highest: 298ns
libriscv: resume execution median 3ns lowest: 3ns highest: 3ns
luajit: call overhead median 53ns lowest: 53ns highest: 81ns
libriscv: array append median 2ns lowest: 1ns highest: 2ns
libriscv: vector append median 3ns lowest: 3ns highest: 5ns
luajit: table append median 18ns lowest: 17ns highest: 28ns
libriscv: 8x arguments median 27ns lowest: 26ns highest: 45ns
libriscv: 8x stored args median 58ns lowest: 56ns highest: 62ns
libriscv: 8x prepared args median 25ns lowest: 24ns highest: 32ns
luajit: 8x arguments median 217ns lowest: 214ns highest: 234ns
libriscv: integer math median 1ns lowest: 1ns highest: 4ns
libriscv: fp math median 6ns lowest: 5ns highest: 9ns
libriscv: exp math median 13ns lowest: 12ns highest: 17ns
libriscv: fib(40) median 14ns lowest: 14ns highest: 16ns
libriscv: taylor(1K) median 657ns lowest: 624ns highest: 687ns
luajit: integer math median 20ns lowest: 18ns highest: 31ns
luajit: fp math median 29ns lowest: 28ns highest: 40ns
luajit: exp math median 34ns lowest: 33ns highest: 57ns
luajit: fib(40) median 33ns lowest: 31ns highest: 41ns
luajit: taylor(1K) median 895ns lowest: 845ns highest: 927ns
libriscv: syscall overhead median 1ns lowest: 1ns highest: 2ns
libriscv: syscall print median 6ns lowest: 6ns highest: 19ns
luajit: syscall overhead median 10ns lowest: 9ns highest: 32ns
luajit: syscall print median 38ns lowest: 36ns highest: 47ns
libriscv: complex syscall median 40ns lowest: 38ns highest: 47ns
luajit: complex syscall median 492ns lowest: 478ns highest: 510ns
libriscv: micro threads median 128ns lowest: 123ns highest: 137ns
luajit: coroutines median 167ns lowest: 163ns highest: 194ns
libriscv: micro thread args median 177ns lowest: 173ns highest: 193ns
libriscv: full thread args median 187ns lowest: 183ns highest: 205ns
luajit: coroutine args median 195ns lowest: 191ns highest: 209ns
luajit: coroutine args median 195ns lowest: 192ns highest: 209ns
libriscv: naive memcpy median 90ns lowest: 89ns highest: 96ns
libriscv: syscall memcpy median 17ns lowest: 16ns highest: 27ns
luajit: memcpy median 97ns lowest: 89ns highest: 172ns
libriscv: syscall memset median 9ns lowest: 9ns highest: 16ns
libriscv: naive memset median 50ns lowest: 49ns highest: 70ns
luajit: memset median 69ns lowest: 68ns highest: 80ns
libriscv: sieve(10M) median 115ms lowest: 115ms highest: 115ms
luajit: sieve(10M) median 132ms lowest: 132ms highest: 132ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment