Repository navigation
Avoid re-sorting spread members from scratch - #64945
Closed
Jake Bailey (jakebailey) wants to merge 1 commit into
Closed
Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
Every object spread builds a member table and sorts its properties by
declaration. Chains such as `{ ...a, x, ...b, y }` re-sort the whole
accumulated set at each step, and each comparison walked the parent
chain of both declarations to find their files. On mui-docs this sort
was about 6% of single-checker time.
Compute each symbol's sort key once, sort already-sorted input and
two sorted runs in linear time, and have spreads list their members
in the order of the two (already sorted) property lists. The sorted
result is the same; only the work to get there changes.
Single-checker check time on mui-docs, five runs each:
before 9.004s 9.103s 9.114s 9.157s 9.207s
after 8.826s 8.879s 8.940s 8.943s 9.032s
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Tsc/bluesky 2.385 ± 5% 2.350 ± 7% ~ (p=0.394 n=6)
Tsc/sentry 10.11 ± 3% 10.07 ± 2% ~ (p=0.699 n=6)
Tsc/t3code-server 8.042 ± 4% 7.920 ± 2% ~ (p=0.240 n=6)
Tsc/mui-docs 6.165 ± 2% 6.105 ± 3% ~ (p=0.394 n=6)
geomean 5.880 5.816 -1.09%
│ old.txt │ new.txt │
│ rss-B │ rss-B vs base │
Tsc/bluesky 1.175Gi ± 3% 1.176Gi ± 1% ~ (p=1.000 n=6)
Tsc/sentry 3.365Gi ± 4% 3.438Gi ± 6% ~ (p=0.132 n=6)
Tsc/t3code-server 2.694Gi ± 8% 2.868Gi ± 7% ~ (p=0.485 n=6)
Tsc/mui-docs 2.290Gi ± 3% 2.337Gi ± 7% ~ (p=0.589 n=6)
geomean 2.222Gi 2.281Gi +2.66%
│ old.txt │ new.txt │
│ heap-B │ heap-B vs base │
Tsc/bluesky 915.3Mi ± 0% 915.1Mi ± 0% ~ (p=0.180 n=6)
Tsc/sentry 2.481Gi ± 0% 2.482Gi ± 0% ~ (p=0.065 n=6)
Tsc/t3code-server 2.178Gi ± 0% 2.179Gi ± 0% ~ (p=0.310 n=6)
Tsc/mui-docs 1.732Gi ± 0% 1.732Gi ± 0% ~ (p=0.240 n=6)
geomean 1.701Gi 1.701Gi +0.02%
Member
Author
|
TypeScript Bot (@typescript-bot) perf test this faster |
Contributor
Contributor
|
Jake Bailey (@jakebailey) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Member
Author
|
Yeah no |
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.
this is a bit sloppy, but I want to run perf