Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I suspect it's going to be the FFI integration.

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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: