Repository navigation
Benchmark v1.1.0: glua at 1.20x C Lua across the suite, 1.15x on the fast loop - #47
Merged
Merged
Conversation
…fast loop All three tables rerun on main at 860bcd2 on a quiet machine, as the method section describes. The method section now says that code layout can move single rows too: the rule rows of the call table are about 15% slower on the fast loop in this build with the same instructions executed, from branch mispredictions in the dispatch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I reran all three benchmark tables on main at 860bcd2 for the v1.1.0 release. The machine was quiet, with the usual
powersavegovernor, and I used the commands in the method section. The README's summary table is updated to match.Scripts across implementations: glua averages 1.20x C Lua, down from 1.23x.
The other engines came out within 0.02 of their published averages.
glua's two loops:
Calls between Go and Lua: I traced the two rows that moved before publishing them.
perf statshows the same number of instructions (26.0 vs 26.1 billion) but 28 times more branch mispredictions in the dispatch of the interpreter loop. Build pattern captures in the result buffer instead of a new slice per match #46 moved the bound-call wrapper by 128 bytes, which changes the branch history the CPU predicts the dispatch from. So this is code layout, not a code change, and the method section now says that layout can move single rows like this.reset,call,VM.enter, and the stack-shrink check inVM.leave), and Measure what an entry or a VM keeps with LiveBytes #37, live bytes, another 7. That's the cost of those features. It may be partly recoverable later.The table rows are pasted from the tools' output. The raw Go results are in the gitignored
bench/results/.