Live data from Hacker News

Beware of Bun.js

gist.github.com

11–20 of 53 posts

Re: Beware of Bun.js

#11
Looks like the sqlite bench complaint was fixed 5 days ago and the react-hello benchmark was fixed earlier today (before the creation time of this gist).

I don't know if the suggested FFI benchmark is fair, as the change would no longer be simulating doing many ffi_hashes on many byteArrays, instead it simulates doing many ffi_hashes on the same byteArray over and over and benefits from caching the type casting necessary by deno.

Replace the const byte array with a randomly generated list (or real bytes you'd want to hash) of many passed to the benchmark as a parameter and the benchmark and the deno one loses the advantage from the cached type cast.

Re: Beware of Bun.js

#12
post #8

Seems a bit of a general theme. Not long ago I saw an article claiming Bun was faster than Rust Hyper webserver, but the author forgot to turn off debug mode. Article is gone now: https://medium.com/cooking-with-bun/hello-world-performance-...

Archived here: https://web.archive.org/web/20220927051406/https://medium.co...

(though medium seems to resist archive.org by reloading the page indefinitely)

Re: Beware of Bun.js

#13
The benchmark, while it seems (without knowing the function specifics) that it is overtesting (testing hash(toptr(n)) instead of just hash(m)), it is the same on both tests so it does feel like a fair comparison? Sure it could be done differently to make a more atomic comparison, but the composite comparison still feels fair if both operations tend to be performed together. Def not an "expose".

Overall though, Bun is an amazing accomplishment for many reasons and I'd love if the project focused a bit less on the supposedly benchmark/performance and more in some other things it brings to the table, like it being based on `JavaScriptCore`, being an alternative to Node but still mostly compatible, the speed of development (vs Node which we've been complaining that has stagnated for years), etc. Not saying not to mention impressive benchmarks, just that it'd be nice to highlight the other points as well!

I personally also don't like the direction Deno was taking, and def welcome Bun as a modern alternative to Node.

Re: Beware of Bun.js

#14

The thing about Bun that turns me off is around the OS-specific system call optimizations (using different optimizations for different platforms) which means that each new feature they add to bun that uses any system calls must be done 3 times for the 3 major platforms (MacOS, Windows, Linux) Another thing is I believe Deno supports WebGPU and Node supports WebGL via Angle etc (for e.g. running Tensorflow with GPU su…

The thing about Bun that turns me off is around the OS-specific system call optimizations (using different optimizations for different platforms) which means that each new feature they add to bun that uses any system calls must be done 3 times for the 3 major platforms (MacOS, Windows, Linux)

You mean just like libuv/node, the JVM and Go?

Re: Beware of Bun.js

#15
This seems to not be entirely reasonable.

[edit: apparently the author is a deno employee but did not choose to disclose such? If so then that throws any moral position they have out the window. The below however is still accurate to my reading of the complaints.]

First up is the FFI test. On the one hand I think that this is a legitimate complaint, changing an existing benchmark for your comparisons is always suspect. That said I can see technically legitimate reasons for the change - for example if bun's ffi interface doesn't actually handle byte arrays as well as other runtimes. But in such a case that should be explicitly called out as a caveat.

The sqlite complaint is not reasonable, if sqlite is being used as a demonstration of wasm performance there is nothing at all wrong with this test - if anything using wasm makes it more valuable as a comparison of runtime perf, otherwise you're very quickly going to just be benchmarking one native build of sqlite to another native build of sqlite.

The React complaint - this just looks like bog standard formatted minified code, which is an absolutely reasonable thing to do - in fact I would argue it is a much better reflection of real world performance than using the non-minified code. Production websites only ever send minified content (at the react scale) and minification absolutely impacts page load performance, and historically could result in catastrophic runtime impact (though they're better at not doing this now).

Re: Beware of Bun.js

#16

Looks like the sqlite bench complaint was fixed 5 days ago and the react-hello benchmark was fixed earlier today (before the creation time of this gist). I don't know if the suggested FFI benchmark is fair, as the change would no longer be simulating doing many ffi_hashes on many byteArrays, instead it simulates doing many ffi_hashes on the same byteArray over and over and benefits from caching the type casting neces…

nope, this is after those updates.

Re: Beware of Bun.js

#18
I wrote a whole long-winded comment here about really having a hard time keeping my biases in check about JS, the ecosystem/devs around it etc.

Then I go to the repo and see Bun is a Zig project.

I've maybe said too much already. :|

Re: Beware of Bun.js

#19

There should be a disclaimer that the author works for Deno https://gist.github.com/littledivy

Mind you, despite being a possible conflict of interest this also provides credentials for likely relevant expertise, with skill and interest in correcting errors.

(Also, disclosure, not disclaimer.)

Re: Beware of Bun.js

#20

Looks like the sqlite bench complaint was fixed 5 days ago and the react-hello benchmark was fixed earlier today (before the creation time of this gist). I don't know if the suggested FFI benchmark is fair, as the change would no longer be simulating doing many ffi_hashes on many byteArrays, instead it simulates doing many ffi_hashes on the same byteArray over and over and benefits from caching the type casting neces…

nope, this is after those updates.

You mean the fixes aren't applied? The sqlite looks like it changed to the sqlite3 version 5 days ago

https://github.com/oven-sh/bun/commit/4b5c9acc72908ba22e3f70...

Post reply on HN