News for hackers. Stuff that matters.
Re:No one cares about Bun's speed. Your CI does though by Jarred on Sunday March 05, 2023 @08:22PM (#35036365)
Tests are run single-threaded currently.

bun:test is fast mostly because it’s integrated deeply into the runtime. Other test runners typically have to mutate globals and spend a lot of time setting up the environment and tearing it down. Also, expect() in bun:test is something like 10x faster[1] than in vitest (100x jest) because it’s written in native code.

Test runners involve a lot of polymorphism which means JS doesn’t get JIT’d much — in cases like that, writing in native is much faster.

Another factor is transpilation time. bun:test supports TypeScript and JSX without plugins and bun’s transpiler is very fast

[1]: https://twitter.com/jarredsumner/status/1595681235606585346?...

There are no comments on this comment yet.