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 Announces Watsonx Hackathon
23/08/2024

IBM is running a Watsonx Hackathon where entrants get access to watsonx featuring IBM Granite and could win a trip to Las Vegas.



Learn Bash Scripting With Learn Linux TV
03/09/2024

Is Bash still relevant in this age of AI? Many wanted the command line bashed (pun intended), deprecated or replaced by something else. If you think it's still worth using, here's a free course f [ ... ]


More News

kotlin book

 

Comments




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