New build tool just come out, 6x faster than Vite, 20x faster than Webpack, built on top of Rust

New build tool just come out, 6x faster than Vite, 20x faster than Webpack, built on top of Rust

·

4 min read

There is a new build tool in the town, and it comes out as faster as many popular options in the production like Vite and Webpack.

This tool is called Farm and it currently has 3.4k stars in their Github. Its creator is brightwu(吴明亮) worked in ByteDance.

The first commit of the Github was from 2 years ago - however I believe the Design and architecture thinking must be longer than that.

What is Farm?

So what is Farm? Quoting from their own intro in their Github readme.

Farm is a extremely fast vite-compatible web-building tool written in Rust. It's designed to be fast, powerful and consistent, aims to provide best experience for web development, which is the real next generation build tool.

Performance Benchmark Comparison

The Stable version 1.0 has been released few weeks now. On top of Rust, they used a benchmark from Turborepo which is to render 1000 React components. and managed to be faster in different timings like Cold Start, Hot Start, HMR, Build Time, etc.

StartupHMR (Root)HMR (Leaf)Production Build
Webpack8035ms345ms265ms11321ms
Vite3078ms35ms18ms2266ms
Turbopack3731ms62ms54ms6442ms
Rspack831ms104ms96ms724ms
Farm403ms11ms10ms288ms

xx

Check this for more info https://github.com/farm-fe/performance-compare on the comparison and benchmark performance.

Other Exciting Features

It is mentioned in their release docs, that Farm is compatible with Vite ecosystem / plugins and not only that it has other features like

  • Basic compilation capabilities

  • Lazy compilation

  • Incremental Building: Module-level disk persistent cache supported, unchanged modules won't be compiled twice, hot start time is reduced by 80%, with lazy compilation enabled, preview projects of any size in 1s

  • Production optimization / Browser compatibility

  • Partial Bundling: Bundle thousands of modules into about 20-30 output files according to dependency ship. Perfectly avoiding the two extreme modes of bundle and bundless and can ensure loading performance while improving cache reuse rate.

  • Plugin Ecosystem

  • SSR Support

Future Features / Roadmaps

  • Continue to build more top-level frameworks, such as SSR framework. (NextJS/ NuxtJS/ etc)

  • Extend the Rust plugin ecosystem, use Rust to implement or reconstruct existing common tools, and provide a more extreme performance experience

My Thoughts on Farm

New technology that comes out every now and then is always great and disrupting the development ecosystem like how even Vite comes out itself because Webpack is slow. I really enjoy how Vite makes it faster for new projects as well compared to 5 years ago where everything will take longer to start and so on (HMR will take 2 - 5 secs in big projects).

With this coming who knows, Vite and other tools may take inspiration from it and grow each other as better tools for the ecosystem.

As Farm is still new to the ecosystem, there soon will be issues and reports for many different testing environment from many people like different devices, OS, etc. Who knows Farm can handle all of those like Vite and the rest do yet. As of the time writing this article Farm has only < 100 issues in their Github.

They have tested Farm with many options as well like Electron and Tauri which is cross platform tools which will definitely speed things up in their build time with Rust multithread features.

I hope for the best for the ecosystem to keep pushing each other to get to a better performance, stability, and scalability throughout the ecosystem.

Quick Start (Try it yourself)

Farm provides official templates to quickly create a React, Vue, Solid, Svelte, etc. project:

pnpm create farm

Then select the type of project, features, etc. to be created. After the project is created, start the project:

pnpm start

You can create and start your first Farm project in 20 seconds!


Let me know your thoughts on the comment below whether Farm will succeed or not and what is your reasoning!