Repository navigation
perf(s2): look up hover fractions with an indexed expression function - #991
Merged
Merged
Conversation
c-lamoureux
force-pushed
the
perf/s2-line-clip-draw-in
branch
from
October 9, 2026 18:01
f0bd757 to
ac9e5b3
Compare
c-lamoureux
force-pushed
the
perf/s2-hover-fraction-fn
branch
3 times, most recently
from
October 9, 2026 18:27
54afac5 to
9ed939b
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r perf story Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c-lamoureux
force-pushed
the
perf/s2-hover-fraction-fn
branch
from
October 9, 2026 20:43
9ed939b to
ce3c0ae
Compare
c-lamoureux
marked this pull request as ready for review
October 9, 2026 20:50
…ype-aware redundant optionals Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…er arg Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Contributor
|
🎨 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-991/ 🎨 S2 Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-991-s2/ 🎨 S2 Dev Storybook -> https://opensource.adobe.com/react-spectrum-charts/PR-991-s2-dev/ 📚 Docs -> https://opensource.adobe.com/react-spectrum-charts/PR-991-docs/ |
madelineluke
approved these changes
Oct 9, 2026
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.



Stacked on #990.
What
hoverFraction(rows, keyField, key, fallback)expression function. It indexeshoverFractionDatarows by key once per data array (aWeakMapcache) and reads each row's value live.indexof(pluck(data(...))), which scanned every series for every item on every frame.features.highlight: false). It runsquerySelectorAll('*')+getComputedStyleon every DOM change in the story, which skewed hover benchmarks.renderer(svg/canvas) arg.Why
With the CSP-safe interpreter, the
pluck/indexoflookup was O(series) per item per frame. The lookup is now O(1) after one index build per data change.Perf
pluckis gone.Testing
hoverFraction(match, fallback, first row wins, live reads).ast: true) that applies modify/insert changesets and checks the lookup stays current. It fails if the function caches values instead of rows.vega-interpreteradded as a devDependency for that test only; no runtime dependency change.