2 ms·
Hey, author here. You're absolutely right, good observation! When writing this post I had actually already moved on towards a compilation step (into bytecode +
by dvko 4y ago
Hey, author here. You're absolutely right, good observation! When writing this post I had actually already moved on towards a compilation step (into bytecode + VM stack machine) where variables are obviously referenced by index. After that (while going back to write this post) somehow traversing the AST while not immediately evaluating it did not feel like tree walking to me. But it obviously still is...
Seeing just how slow looking up variables by their name is, I have a feeling this probably amounts to the biggest performance improvement that the bytecode + VM brings to the table (it's ~3 times faster than the AST walker at the time of writing). Especially as there do not seem to be that many cache misses (at least on my hardware) already, sub .2%.
Anyway, thank you for your $.02!