Faster Bun Released |
Written by Kay Ewbank | |||
Tuesday, 13 August 2024 | |||
Bun v1.1.22 has been released with performance improvements so xpress is now three times faster in Bun, ES modules load faster on Windows, and there's a 10% faster Bun.serve() at POST requests. Bun is a modern JavaScript runtime aiming at similar uses to Node or Deno. The developers describe it as a fast, all-in-one toolkit for running, building, testing, and debugging JavaScript and TypeScript, from a single file to a full-stack application. This release includes performance and compatibility improvements to Bun's node:http implementation, which the developers say increases express request throughput by 50% compared to Bun v1.1.21, which means it is three times faster in Bun than Node.js running the same code. Another improvement to performance means ES modules load up to four times faster on Windows. This has been achieved by adding concurrent transpilation support to Bundows. The addition was necessary because Bun transpiles every file on the fly to make running TypeScript, JSX, ES modules, and CommonJS all just work in Bun. Bun.serve() is also 10% faster at POST requests so long as your code does not read the body of an incoming Request. Bun's memory usage has also been improved through a number of changes, starting with better handling of bun --hot to reload code. In the previous versions, Bun didn't always release the source code for old versions of modules, and a similar thing happened when code or dependencies modified require.cache, which is a common pattern for reloading code. By handling these situations better, Bun now uses two times less memory when you use bun --hot. Another memory handling improvement is when importing modules that are garbage collected. The developers have fixed a bug where importing or requiring a module that is garbage collected would keep a reference to that module's source code. The team has also patched various memory leaks, including when requiring a CommonJS module; computing line offsets in source maps; and transpiling more than 64 files concurrently. Bun 1.1.22 is available now. More InformationRelated ArticlesBun 1.0 Released With Experimental Windows Version Bun JavaScript Runtime Adds Runtime Plugin API To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |