On my machine (M1 pro), Bun calling into a C library and running a no-op is 15x faster than Python calling a no-op function. V8 has never had stable bindings but Bun is changing the game with a TinyCC JIT-compiled FFI that yields a simple API.
$ bun bench.js
3.5331715910204884 nanoseconds per iteration
$ python3 -m timeit -s 'def f(): pass' 'f()'
5000000 loops, best of 5: 53.8 nsec per loop
brrrrrm|3 years ago
On my machine (M1 pro), Bun calling into a C library and running a no-op is 15x faster than Python calling a no-op function. V8 has never had stable bindings but Bun is changing the game with a TinyCC JIT-compiled FFI that yields a simple API.