Specialized bytecodes#40
Conversation
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
|
Fixed a bug which improved the perf of the send bytecodes a bit. Also added macros to avoid repetition in the bytecode handlers. These bytecode should play very nicely with #39 (especially Pretty much ready to merge in my book, just missing a couple more tests (and also for me to look at the TODOs I left in the code.. some are outdated). Let me know what you think when you get the time, Nicolas |
There was a problem hiding this comment.
The performance increase is very nice to see for simply specializing some very common bytecode.
I really like the fact that you implemented a bytecode deduplication routine in there.
A more fleshed out "optimisation pass" system could be beneficial to cleanly implement various bytecode cleanup routines (like I thought about one for class methods that use RETURN_NON_LOCAL while outside of any closure, in which case we could transform them into simpler RETURN_LOCAL instructions).
This is something I'll add on my To-Do list.
I just have some minor remarks here and there, but nothing major.
Co-authored-by: Nicolas Polomack <nicolas@polomack.eu>
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
|
Here are the benchmark results for
|
|
Here are the benchmark results for Bytecode interpreter
|
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
|
Here are the benchmark results for AST interpreter
Bytecode interpreter
|
24e63af to
d94bb24
Compare
|
Here are the benchmark results for
|
|
I think the test runner didn't appreciate my accidental spam. Either way, I've finished with implementing your changes and writing tests |
Hirevo
left a comment
There was a problem hiding this comment.
I think the test runner didn't appreciate my accidental spam.
Yeah, there is no pipelining in place yet, so everything kinda ran at once.
I should have put it in place by now, sorry about that.
I'll go and implement this, it shouldn't take too much effort to build.
Either way, I've finished with implementing your changes and writing tests.
Ok, the changes look all good to me, so let's merge this !
Thanks a bunch for all this work !
New, specialized bytecodes:
PushConstant0PushConstant1PushConstant2Push0Push1PushNilSend1Send2Send3SendNSuperSend1SuperSend2SuperSend3SuperSendN..which were really just me looking at the PySOM bytecode set and thinking "oh yeah, that sounds like a useful bytecode"
The speedup is 9% on average or so for me.
The code duplication in
interpreter.rsfor all the specialized send bytecodes is a bit ugly, should probably replace those withsendandsuper_sendfunctions tagged with#[inline].