Repository navigation
Memoize repeated inference walks - #64880
Draft
Jake Bailey (jakebailey) wants to merge 1 commit into
Draft
Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
Some inference walks are long and are made again and again with the
same inputs. With Effect Schema, every call such as Schema.optional(x)
inside a Struct({ ... }) infers from the contextual Constraint type to
the combinator's return type, optional<S>, whose members span the large
schema interfaces. Each call repeats that walk from fresh inference
infos and always ends in the same candidates. Effect-heavy code like
t3code spends a large share of its check time this way.
When every inference info is still in its initial state, the outcome of
a walk is now remembered under its source, target, priority,
contravariance and type parameters, as long as the walk computed nothing
new and observed no transient state, so walking it again would take the
same path. Transient state is any read of an in-progress resolution,
signature resolution, variance computation, flow loop or flow type
cache, which are now counted.
Measured with --checkers 4 (n=8):
│ before.txt │ after.txt │
│ sec/op │ sec/op vs base │
Tsc/bluesky 3.069 ± 4% 3.024 ± 1% -1.47% (p=0.038 n=8)
Tsc/sentry 12.74 ± 2% 12.62 ± 1% ~ (p=0.382 n=8)
Tsc/t3code-server 16.81 ± 3% 16.12 ± 4% -4.12% (p=0.028 n=8)
geomean 8.694 8.505 -2.17%
│ before.txt │ after.txt │
│ rss-B │ rss-B vs base │
Tsc/bluesky 1.422Gi ± 2% 1.413Gi ± 1% ~ (p=0.959 n=8)
Tsc/sentry 4.571Gi ± 8% 4.617Gi ± 4% ~ (p=0.721 n=8)
Tsc/t3code-server 4.378Gi ± 2% 4.650Gi ± 6% +6.21% (p=0.038 n=8)
geomean 3.053Gi 3.119Gi +2.16%
│ before.txt │ after.txt │
│ heap-B │ heap-B vs base │
Tsc/bluesky 1.152Gi ± 0% 1.153Gi ± 0% ~ (p=0.195 n=8)
Tsc/sentry 3.620Gi ± 0% 3.622Gi ± 0% ~ (p=0.195 n=8)
Tsc/t3code-server 3.761Gi ± 0% 3.763Gi ± 0% +0.04% (p=0.000 n=8)
geomean 2.504Gi 2.504Gi +0.03%
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: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Repositorios.. |
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.
WIP