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.

bun

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.

bun12

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. 

bun

More Information

Bun Website

Bun On GitHub

Related Articles

Bun 1.0 Released With Experimental Windows Version

Bun Adds Hot Reloading

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.

Banner


Azure Container Apps Dynamic Sessions Generally Available
02/12/2024

Dynamic Session support has been added to Azure Container Apps. Azure Container Apps is a serverless platform for running containerized applications, and dynamic sessions is designed to provide fast a [ ... ]



A Tee Is Not Just For Xmas - Top Tees
20/12/2024

Programmer gifts - easy idea, difficult implementation.  Here's our pick of tee-shirts for giving, buying or just wearing at any time of the year.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info