Skip to content

Instantly share code, notes, and snippets.

@fwsGonzo
Last active January 5, 2024 20:57
Show Gist options
  • Save fwsGonzo/1af5b2a9b4f38c1f3d3074d78acdf609 to your computer and use it in GitHub Desktop.
Save fwsGonzo/1af5b2a9b4f38c1f3d3074d78acdf609 to your computer and use it in GitHub Desktop.
Interpreted libriscv vs. 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.493455, 1296.997474 mip/s
libriscv: call overhead median 4ns lowest: 3ns highest: 5ns
libriscv: preempt overhead median 12ns lowest: 12ns highest: 23ns
libriscv: fork median 202ns lowest: 199ns highest: 218ns
libriscv: resume execution median 3ns lowest: 3ns highest: 4ns
luajit: call overhead median 53ns lowest: 53ns highest: 133ns
libriscv: array append median 2ns lowest: 2ns highest: 13ns
libriscv: vector append median 8ns lowest: 7ns highest: 12ns
luajit: table append median 17ns lowest: 16ns highest: 43ns
libriscv: 8x arguments median 39ns lowest: 38ns highest: 43ns
libriscv: 8x stored args median 31ns lowest: 29ns highest: 37ns
libriscv: 8x prepared args median 39ns lowest: 38ns highest: 47ns
luajit: 8x arguments median 218ns lowest: 213ns highest: 233ns
libriscv: integer math median 3ns lowest: 3ns highest: 4ns
libriscv: fp math median 12ns lowest: 10ns highest: 23ns
libriscv: exp math median 16ns lowest: 14ns highest: 23ns
libriscv: fib(40) median 165ns lowest: 162ns highest: 175ns
libriscv: taylor(1K) median 6823ns lowest: 6636ns highest: 7313ns
luajit: integer math median 19ns lowest: 18ns highest: 42ns
luajit: fp math median 29ns lowest: 27ns highest: 41ns
luajit: exp math median 33ns lowest: 32ns highest: 42ns
luajit: fib(40) median 32ns lowest: 29ns highest: 42ns
luajit: taylor(1K) median 867ns lowest: 815ns highest: 927ns
libriscv: syscall overhead median 1ns lowest: 1ns highest: 3ns
libriscv: syscall string median 5ns lowest: 4ns highest: 6ns
luajit: syscall overhead median 10ns lowest: 9ns highest: 38ns
luajit: syscall string median 36ns lowest: 35ns highest: 44ns
libriscv: complex syscall median 58ns lowest: 50ns highest: 62ns
luajit: complex syscall median 492ns lowest: 484ns highest: 602ns
libriscv: micro threads median 120ns lowest: 117ns highest: 124ns
luajit: coroutines median 163ns lowest: 159ns highest: 194ns
libriscv: micro thread args median 171ns lowest: 167ns highest: 182ns
libriscv: full thread args median 179ns lowest: 175ns highest: 195ns
luajit: coroutine args median 192ns lowest: 187ns highest: 209ns
luajit: coroutine args median 196ns lowest: 192ns highest: 220ns
libriscv: naive memcpy median 321ns lowest: 278ns highest: 721ns
libriscv: syscall memcpy median 16ns lowest: 15ns highest: 29ns
luajit: memcpy median 97ns lowest: 91ns highest: 114ns
libriscv: syscall memset median 9ns lowest: 9ns highest: 17ns
libriscv: naive memset median 188ns lowest: 180ns highest: 275ns
luajit: memset median 73ns lowest: 71ns highest: 81ns
libriscv: sieve(10M) median 142ms lowest: 142ms highest: 142ms
luajit: sieve(10M) median 120ms lowest: 120ms highest: 120ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment