E-Ink News Daily

Back to list

Replacing a Rust Enum with a 64-bit Word Made My Interpreter 17% Faster

The author benchmarks replacing a Rust tagged enum with a 64-bit packed word representation for a Plush language interpreter's Value type, achieving a 17% performance gain. This optimization continues their series on making an interpreted language fast enough for real-time 3D animation rendering. The change reduces memory overhead and improves cache locality compared to pointer-based enum variants.

Background

This is the sixth post in a series on optimizing the Plush language interpreter and VM, following prior work on garbage collection improvements. Dynamic language interpreters commonly use tagged unions or equivalent representations to handle values of varying types.

Source
Lobsters
Published
Aug 25, 2026 at 10:40 PM
Score
6.0 / 10