3 ms·
Funny, I actually have some fib benchmarks for my RISC-V emulator! It uses fib(40), but I added one for 20. Interestingly, that is the one benchmark that LuaJIT
by fwsgonzo 6y ago
Funny, I actually have some fib benchmarks for my RISC-V emulator! It uses fib(40), but I added one for 20. Interestingly, that is the one benchmark that LuaJIT crushes my emulator in, so I'm still working on beating it, but i don't really have any plan. :)
libriscv: fib(20) median 317ns lowest: 310ns highest: 356ns
luajit: fib(20) median 146ns lowest: 145ns highest: 170ns
lua5.4: fib(20) median 631ns lowest: 598ns highest: 694ns
Running your emulator:
$ ./fibrec
567us
Modern compilers used with emulated machines can beat even v8 at times.
Cool project! I divided your number by 100, is that correct? Is there some additional overhead in setting up / tearing down something?
- codr7 6y agoCorrect, all benchmarks run 100 repetitions of fib(20). There is no additional overhead that I'm aware of except calling a function in a loop, which is intentional.