top | item 32463073

(no title)

riston | 3 years ago

The problem with Bun currently is the missing killer feature, there is no absolute reason to switch over or I might be wrong?

discuss

order

brrrrrm|3 years ago

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