Skip to content

Million.js vs Preact

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

Million.js

Open source · MIT

An optimizing compiler that speeds up React components by skipping most of React's diffing work.

Preact

Open source · MIT

A small (about 4kB) React-style library for building user interfaces in JavaScript.

The short answer

Choose Million.js if you need…

  • React developers whose apps have many elements that update often
  • Teams looking for a performance boost without rewriting their components
  • Developers who want to experiment with compiler-based optimizations

Choose Preact if you need…

  • Web developers who already know React and want a lighter library
  • Projects where small bundle size matters, such as pages loaded over slow connections
  • Teams that want an optional compatibility alias (preact/compat) to reuse React-based code
  • Developers building apps that need server-side rendering with hydration

Side-by-side

Million.jsPreact
TypeLibraryLibrary
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars17.7k39k
Setup difficultyIntermediateIntermediate
How you get itInstall with a package managerInstall with a package manager
Main languageTypeScriptJavaScript
Last code update6 months ago4 days ago

What each one is

Million.js

Million.js is a compiler for React that aims to make components update faster. Instead of React comparing old and new snapshots of the interface to find changes, the README says Million.js generates code that updates the affected DOM nodes directly. The project claims components can be up to 70% faster, citing an external benchmark.

Preact

Preact is a JavaScript library for building user interfaces out of reusable components, using an API that closely follows React. The README describes it as a fast, roughly 4kB alternative to React with a similar modern API, covering components, hooks, JSX, and a virtual DOM. Developers use it when they want React-style code with a much smaller download size.

Best for

Million.js

  • React developers whose apps have many elements that update often
  • Teams looking for a performance boost without rewriting their components
  • Developers who want to experiment with compiler-based optimizations

Preact

  • Web developers who already know React and want a lighter library
  • Projects where small bundle size matters, such as pages loaded over slow connections
  • Teams that want an optional compatibility alias (preact/compat) to reuse React-based code
  • Developers building apps that need server-side rendering with hydration

Strengths

Million.js

  • Clear core idea: skip diffing and update the DOM node directly
  • Installs through a single CLI command according to the README
  • Open source under the MIT license with an active CI badge and npm package

Preact

  • Very small size (the README states about 4kB), which helps page load time
  • Familiar React API, including class components, hooks, and functional components
  • MIT licensed with a large community and many stars on GitHub

Not ideal for

Million.js

  • Projects not using React, since the README describes Million.js as working with React
  • Beginners who just want to build a simple site, because the setup and internals add complexity
  • Teams that need a fully verified performance gain, since the 70% figure comes from the project's own benchmark link and the README does not detail the conditions

Preact

  • Complete beginners who have never written JavaScript; the README assumes familiarity with components and modern JS syntax
  • Projects that depend on React-only libraries without testing compatibility, since the README only describes compatibility as 'extensive' via an alias and does not list limits
  • Native mobile app development, which the README does not mention

Trade-offs

Million.js

  • Performance claims rely on the project's benchmark and demo; results in your app may differ
  • The README is truncated and the setup details point to external docs
  • Its approach is a compiler layer on top of React, which adds another build-time component to understand

Preact

  • The README is truncated and gives limited detail on edge-case React compatibility
  • Some React ecosystem libraries may need the compat layer or may not work fully
  • Tooling such as DevTools and HMR depends on additional setup that the README only briefly mentions

Getting started

Million.js

Run the Million.js CLI to install and configure your project

npx million@latest
Step-by-step guide: how to use Million.js

Preact

Install from npm

npm install preact
Step-by-step guide: how to use Preact

Frequently asked questions

What is the difference between Million.js and Preact?

Million.js: An optimizing compiler that speeds up React components by skipping most of React's diffing work. Preact: A small (about 4kB) React-style library for building user interfaces in JavaScript. Million.js suits react developers whose apps have many elements that update often, while Preact suits web developers who already know react and want a lighter library.

Are Million.js and Preact free?

Million.js: Free and open source. Preact: Free and open source.

Is Million.js or Preact more popular?

Preact has more GitHub stars (39k) than Million.js (17.7k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to Million.js and Preact?

Other options people compare them with include Solid, ahooks, useHooks, react-virtualized, Inferno.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.