-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Avoid resolving objects in getTypeFacts when caller doesn't need that info #55459
Conversation
@typescript-bot perf test this |
Heya @jakebailey, I've started to run the regular perf test suite on this PR at 0432611. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the tarball bundle task on this PR at 0432611. You can monitor the build here. |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@jakebailey Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
A percent, maybe? |
@typescript-bot perf test this full |
Heya @jakebailey, I've started to run the full perf test suite on this PR at 0432611. You can monitor the build here. Update: The results are in! |
@jakebailey Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
I'm going to take this out of draft as I think that even if it's at most a percent, we really kinda need a lot of small 1% wins. Curious what you all think here. |
@@ -26110,7 +26110,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
resolved.members.get("bind" as __String) && isTypeSubtypeOf(type, globalFunctionType)); | |||
} | |||
|
|||
function getTypeFacts(type: Type): TypeFacts { | |||
function getTypeFacts(type: Type, mask: TypeFacts): TypeFacts { |
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.
I kept the name, but maybe it deserves to be called something else.
@typescript-bot test top100 |
Heya @jakebailey, I've started to run the diff-based user code test suite (tsserver) on this PR at e25b6b7. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at e25b6b7. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based top-repos suite (tsserver) on this PR at e25b6b7. You can monitor the build here. Update: The results are in! |
Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at e25b6b7. You can monitor the build here. |
Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at e25b6b7. You can monitor the build here. Update: The results are in! |
@jakebailey Here are the results of running the user test suite comparing Everything looks good! |
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
Hey @jakebailey, it looks like the DT test run failed. Please check the log for more details. |
This stems from a discord conversation (#54939 (comment)) where
getTypeFacts
spends all of its time resolving structured type members, when all it cared about was whether or not the type was nullable.It turns out that the vast majority of calls to
getTypeFacts
only care about a subset of flags (and mainly, nullable-ness), so this may be a perf win.