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


IBM Opensources AI Agents For GitHub Issues
14/11/2024

IBM is launching a new set of AI software engineering agents designed to autonomously resolve GitHub issues. The agents are being made available in an open-source licensing model.



Google Opensources Privacy Library
08/11/2024

Google is making a new differential privacy library available as open source. PipelineDP4J is a Java-based library that can be used to analyse data sets while preserving privacy.


More News

espbook

 

Comments




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