← Back to Tech Radar
Hacker News tech

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

Trending on Hacker News: Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster (59 points / 23 comments, via pointersgonewild.com)

In one line

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

Opening excerpt

This blog post is the sixth in a series about my work building and optimizing the Plush language interpreter and virtual machine. The previous one was Speeding Up the Plush Garbage Collector . In the last post, I explained how a few simple changes made the copying GC over 16x faster, and brought the collection time for a million objects down to around 7 ms. I’m having a lot of fun optimizing Plush just for the sake of it, but I’m also doing it with the goal in mind of being able to make the language fast enough to render 3D animations in real-time, even though it’s interpreted.

Plush is a dynamically-typed language, in the same family as Python, JavaScript, Ruby, Lua, and Lox. Dynamic languages like this have the property that types are attached to values rather than variables, and so to propagate values around programs, an interpreter typically has a Value type that can represent any value that could exist in the language. What I did with the original version of Plush is that I used a plain Rust tagged enum.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (59 points / 23 comments, via pointersgonewild.com). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services

Related Reading