Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster
Hacker News 热议:Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster(59 赞 / 23 评论,来源 pointersgonewild.com)
一句话概要
Replacing a Rust Enum with a 64-bit Word Made My Interpreter 17% Faster
原文开头节选
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.
(以上为原文节选,完整内容见下方”原文来源”)
这条动态今日登上 Hacker News 首页(59 赞 / 23 评论,来源 pointersgonewild.com)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。
原文来源: Hacker News