Key improvements in Million.js 3.0
mainMillion 3.0 introduces significant performance optimizations in both the build and runtime phases:
Faster Build Time
The compiler has been overhauled for better efficiency and scalability. Benchmarks for a medium-sized Next.js project show:
- Initial compile: ~34% faster (3.2s -> 2.1s).
- Code changes: ~82% faster (1.1s -> 0.2s).
Faster Runtime
- Hydration: The hydration process has been refactored. Instead of replacing the DOM at component boundaries, Million.js can now pinpoint specific hydration points, resulting in significantly faster hydration times (initial benchmarks show a ~100% improvement, e.g., 2s -> 1s).
- Reduced DOM overhead: Work is ongoing to remove the dependency on
<slot>elements for mounting blocks, which reduces unnecessary DOM nodes, improves reconciliation, and lowers memory usage.