Repository navigation
Keep Lua registers and code in separate halves of a page - #18
Merged
Merged
Conversation
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.
ArithConst was bimodal between processes because a Lua register and a code word shared their low 12 address bits, and the physical pages decided the rest. Registers now stay in the lower half of a page and code in the upper half, using Go's size classes, without
unsafeorreflect.ArithConst over 24 runners and 288 fresh processes of each version: 21 over 1.3 before, none after. Worst value per processor went from 1.67-1.88 to 0.82-1.07.
Other scenarios: within 1% when only the placement is switched inside one binary. Comparing two binaries moves StructRoundTrip by 1.13 and RedisCall by 0.91 on EPYC 7763, which is code layout.
Costs: a small compiled script retains about 4 KB more, and creating and finishing a coroutine takes 5.9 us instead of 4.4 us.
Deep recursion past R84, functions over 256 words and other pairs of loads and stores are not covered. Details are in docs/adr/0013-register-and-code-placement.md.