Repository navigation
Add noncopyable JSUniqueRef with heap references skipping deduplication - #830
Open
MaxDesiatov wants to merge 1 commit into
Open
MaxDesiatov wants to merge 1 commit into
MaxDesiatov wants to merge 1 commit into
Conversation
…tion `JSUniqueRef` owns one JavaScript object reference from the heap's new `retainUnique`, which allocates a slot without a `_slotByValue` entry. `JSObject(_:)` consumes one and swaps it for `retain`'s reference, `JSObject` ids stay equal for the same object. CI's stale-runtime check now diffs the runtime templates, since diffing their symlinks passed with stale templates.
Contributor
|
I ran a js-framework-benchmark with ElementaryUI locally comparing current main with a version adopting JSUniqueRef (both PRs combined): Total is the time from the click to the end of the next paint (this is what the benchmark compares)
|
This branch has not been deployed
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.
JSUniqueRefowns one JavaScript object reference from the heap's newretainUnique, which allocates a slot without a_slotByValueentry.Every heap slot can now hold at most 8,388,607 references (2^23-1), down from 16,777,215 (2^24-1). That applies to ordinary references too, because bit 23 is now the flag for references that skip deduplication.
CI's stale-runtime check now diffs the runtime templates, since diffing their symlinks passed with stale templates.
In benchmarks I compared
main, #829, and this PR with following code:Both the copyable and the noncopyable wrappers are backed by the same JavaScript classes (run.js:8-15):
Operations measured with each loop body running 100,000 times,
roundtripis created once before the loop. Dropping a wrapper callsswjs_releaseResults with median ns per iteration: