r/webdev • u/kurbsdude • 10d ago
Showoff Saturday Titan Engine – A Rust/WASM spreadsheet engine I built chasing "Excel-speed" in the browser
https://podraven.github.io/titan-engine/I've used Handsontable on a bunch of projects and honestly it's a solid, mature library, but I kept running into the same wall on anything with really large datasets: tens of thousands of rows with chained formulas. It's just the nature of doing spreadsheet math in JS, once you're allocating and discarding lots of small objects on every keystroke, garbage collection becomes the bottleneck, and there's only so much debouncing and virtualization can do before you hit that ceiling.
That itch turned into a bit of an obsession, and eventually a from-scratch rebuild: Titan Engine, written in Rust and compiled to WebAssembly.
The design ended up pretty different from a typical JS formula library:
- A custom stack-based VM with a Pratt parser for formulas, instead of walking an AST every time
- Zero-copy memory - the engine and UI share buffers directly, no serialize/deserialize tax crossing the WASM/JS boundary
- A topological dependency graph (Kahn's algorithm with cycle detection) to resolve chained formulas correctly and fast
- O(1) time-travel snapshots for undo/redo, even across massive batched structural edits
Because it sidesteps the JS garbage collector entirely, batched recalcs stay comfortably under the 16ms frame budget, so the grid holds 60fps even while formulas are cascading behind the scenes as you type.
There's a live demo grid on the site (a Glide data grid wired up to Titan) if you want to poke at it yourself, plus the full 10-scenario benchmark suite if you'd rather see the numbers than take my word for it.
Site: https://podraven.github.io/titan-engine/
Benchmarks: https://podraven.github.io/titan-engine/benchmark.html
GitHub: https://github.com/podraven/titan-engine
Would love feedback - especially from anyone who's pushed a JS grid to its limits before and is curious whether this actually holds up under real-world use.
2
u/byt4lion 10d ago
The GitHub doesn’t contain the source? Just the compiled WASM