Bun vs Node.js: The Better Bundler

At Hitabis, we’re deeply involved in Green Coding — after all, we developed our own tool, Oaklean, to measure energy consumption at the code level. Our experience shows: the biggest potential is often NOT where you’d first expect it.
After comparing runtime vs. runtime, we wanted to go a step further. What about bundlers? The choice of bundler has a massive impact on production builds that process large amounts of data daily. That adds up quickly. So choosing the right bundler is a major lever for saving electricity and server costs.


The Measurement

We built a TypeScript project with different bundlers, then ran it 50 times with identical test data and measured energy consumption in millijoules (mJ) using our open-source tool Oaklean (https://www.oaklean.io/). We looked at an older Node version, the current one, and the LTS version.

The Results

BundlerBunNode@22Node@24Node@25
Bun Bundler509 mJ897 mJ853 mJ888 mJ
TSC1103 mJ1547 mJ1493 mJ1403 mJ
esbuild1136 mJ1702 mJ1380 mJ1402 mJ
webpack1078 mJ1627 mJ1488 mJ1516 mJ
rollup1132 mJ1729 mJ1431 mJ1392 mJ
parcel1209 mJ1514 mJ1435 mJ1475 mJ

Key Findings

1. The Bun Bundler is unbeatable: at 509 mJ it uses ~50% less than TSC and ~40% less than all other bundlers.
2. Node@24 and Node@25 are more efficient than Node@22: For the Bun Bundler, Node@24 is optimal; for TSC/TypeScript, Node@25 offers slight advantages.
3. Bun Runtime + Bun Bundler = Maximum Efficiency: the combination consumes only 509 mJ (Bun→Bun) vs. 1702 mJ (Node@22→esbuild).


Conclusion

The Bun Bundler is the most energy-efficient JavaScript bundler — whether for Bun or Node runtime. Combined with Bun or Node@24, energy consumption in the build process can be reduced by ~50%. For Green Coding, switching is worthwhile not just for the runtime, but also for the build tool chain.