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


Terraform Fork OpenTofu 1.9 Adds Provider Iteration
28/01/2025

OpenTofu 1.9 has been released. The open source infrastructure as code tool is a fork of Terraform. It began development with backing from the Linux Foundation when Terraform developers HashiCorp chan [ ... ]



GitHub Copilot Gets Agent Mode
10/02/2025

GitHub has announced new features for GitHub Copilot to streamline coding tasks. Copilot will now predict what a developer might be going to type next based on what they have already typed. The tool a [ ... ]


More News

espbook

 

Comments




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