Re:Comparing Implementations of the Monkey Language VIII: Ru...
by eatonphil on Monday June 06, 2022 @01:52AM
(#31637593)
> Ironically, I didn't get _any_ speed up using the interpreter vs the compiler in my TS implementations. I'm not sure if that's because I wasn't careful enough with memory allocation in the compiler or V8 had already sped up the interpreter as fast as it was going to go. It's been on my list to dig in and try to fix that, but I've since moved onto other projects.
What were your benchmark programs?
Re:Comparing Implementations of the Monkey Language VIII: Ru...
by xavdid on Monday June 06, 2022 @01:07PM
(#31643006)
I used the recursive fibonacci implementation from the book. You can see the whole bookmarking script here: https://github.com/xavdid/monkey-ts/blob/a3d1789cbb80e33316a...
I've also got the node profiler results here: https://github.com/xavdid/monkey-ts/tree/a3d1789cbb80e33316a...
Re:Comparing Implementations of the Monkey Language VIII: Ru...
by ufo on Monday June 06, 2022 @08:47AM
(#31639785)
I guess that most likely it is not due to v8 magic optimizing the interpreter as much as it can be. The end result of v8 optimizing an AST interpreter is not the same as the end result of v8 optimizing a bytecode interpreter.
Re:Comparing Implementations of the Monkey Language VIII: Ru...
by xavdid on Monday June 06, 2022 @01:10PM
(#31643039)
That makes sense, but I thought it was odd that the two implementations had _identical_ timing results. I should really dig more into it, I just haven't.
I linked the benchmarking script and results in this comment if you're curious: https://news.ycombinator.com/item?id=31643006
Ironically, I didn't get _any_ speed up using the interpreter vs the compiler in my TS implementations. I'm not sure if that's because I wasn't careful enough with memory allocation in the compiler or V8 had already sped up the interpreter as fast as it was going to go. It's been on my list to dig in and try to fix that, but I've since moved onto other projects.