3 ms·
I'm surprised their threaded interpreter was slower than switch, this doesn't reflect my benchmark as well even for post-Haswell CPU. Also this is not true on
by mratsim 8y ago
I'm surprised their threaded interpreter was slower than switch, this doesn't reflect my benchmark as well even for post-Haswell CPU.
Also this is not true on non-x86 hardware and I unfortunately didn't test on AMD.
The article should at least cite this paper regarding Haswell branch prediction: https://hal.inria.fr/hal-01100647/document https://hal.inria.fr/hal-01100647/document "Branch Prediction and the Performance of Interpreters -
Don’t Trust Folklore", 2015, Rohou et al.
Also I'm leaving my interpreter optimization resources here with decades of research papers and highlights of the techniques I found most interesting when implementing a fast VM: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources https://github.com/status-im/nimbus/wiki/Interpreter-optimiz...
- vkazanov 8y agoYeah, it's a very good collection you got there! some of the papers I read, others are in the queue. I was also surprised to see the switch-based solution winning here. But I was even more surprised to see how a simple change (a primitive stack top caching) suggested by one of the readers radically changed my perf benchmarks: the threaded interpreter was the fastest interpreter again.