-
-
Notifications
You must be signed in to change notification settings - Fork 164
perf(codegen,runtime): polymorphic key-add sites are served inline from hashed home ways #11436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3d6aeea
perf(runtime): a representation change takes no typed-feedback lock w…
d44ba71
perf(codegen,runtime): a polymorphic key-add site serves its memos in…
0a3228b
changelog: keyadd-poly
e3c6339
perf(runtime): a key-add memo served from beyond the inline ways move…
451cdad
changelog: keyadd-poly names the far-memo move
c96b584
changelog: name the fragment after PR #11436
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| Polymorphic key-adding stores are now served inline. A store site that holds | ||
| several key-add memos (one per receiver pre-shape, e.g. a base-class | ||
| constructor seeing each subclass) places each further memo at its pre-shape's | ||
| home way, a hash of the ShapeId, and the emitted hit compares that one way | ||
| after the primary memo: one extra compare whatever the number of shapes. The | ||
| key-add memo is also compared before the existing-key ways, the per-object | ||
| header checks are one test on the hot path, and a key-add on a typed-layout | ||
| receiver (an object literal) no longer takes the typed-feedback registry lock | ||
| when typed feedback is off, which cut about 180 instructions from each such | ||
| add. | ||
| A memo the runtime serves from beyond the two ways the emitted hit compares | ||
| (its home was taken by an earlier, often transient, shape) now moves into one | ||
| of them, so a site's hot shapes end up served inline; on tsc this cut | ||
| runtime-served key-adds per transpile from 406,464 to 152,424. | ||
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
The changelog gives the wrong number of inline probes.
Lines 4-5 say that the emitted hit compares "that one way" and costs "one extra compare". The emitter compares two ways: the home way and the next way (
ADD_WAY_PROBES = 2incrates/perry-codegen/src/expr/put_value_store_ic.rs). Lines 11-12 of this file also mention "the two ways". The release note therefore contradicts itself and the code.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents