Skip to content
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

Handle huge unions better in createUnionOrIntersectionProperty #30411

Merged

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Mar 14, 2019

Fixes #29834 - or at least makes it more tolerable.

Timeline before this fix, roughly 7 seconds until first results for a quickinfo relying on the 1MB data object:
image

Timeline after this fix for the same info:
image
Down to 2s. (Specifically, time in createUnionOrIntersectionProperty was cut from 5s down to 340ms)

That's a pretty big improvement for just fixing property creation so it's not O(n^2) with property count. 😄

There's not really a test associated with this change because, well, perf...

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this change performance on union-heavy code like our compiler-unions case?

@weswigham
Copy link
Member Author

There's not really a noticeable difference in check time one way or the other in the Compiler - Unions perf test.

image

@weswigham
Copy link
Member Author

@typescript-bot perf test 🕙

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 18, 2019

Heya @weswigham, I've started to run the perf test suite on this PR at 44e0aa0. You can monitor the build here. It should now contribute to this PR's status checks.

@weswigham
Copy link
Member Author

@sandersn There's no perf diff between this branch and master.

@weswigham weswigham merged commit 1639a5a into microsoft:master Mar 22, 2019
@weswigham weswigham deleted the handle-huge-unions-efficiently-in-props branch March 22, 2019 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening/editing project file causes 100% CPU usage by tsserver
4 participants