-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Sort types for display #44614
Sort types for display #44614
Conversation
Pushing to a PR for performance testing. This looks extremely slow.
@typescript-bot perf test this |
Heya @sandersn, I've started to run the perf test suite on this PR at 72a1808. You can monitor the build here. Update: The results are in! |
@sandersn Here they are:Comparison Report - main..44614
System
Hosts
Scenarios
Developer Information: |
@@ -365,6 +365,93 @@ namespace ts { | |||
|
|||
const argumentsSymbol = createSymbol(SymbolFlags.Property, "arguments" as __String); | |||
const requireSymbol = createSymbol(SymbolFlags.Property, "require" as __String); | |||
const fail = (name: string) => () => Debug.fail("Unit kind expected for " + name) | |||
// boolean, bigint, number, string, symbol [literal], boolean, bigint, number, string, symbol, object, union (recursive?!), ..., unknown, never, null, void, undefined, any | |||
const ordre: Array<[TypeFlags, (t1: Type, t2: Type) => Comparison]> = [ |
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.
order?
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.
This is a draft, so this is just the name that fell out of my brain and it happened to be in French. (I often use short, intentionally bad names so I'll be forced to change them later.)
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.
Got it :)
Do we have declaration emit captured in the perf tests? |
@amcasey seemed to think not, so on his recommendation I have been testing by compiling tinymce instead. However, it has around 1000 unions, which may not be enough to detect a worst-case slowdown. Maybe I should find a gnarly DT package, read it, then print it out and see how long printing it takes. |
Notes from discussion in our team meeting:
|
Well, this was an interesting experiment, but after finishing the sort code, I found the best performance test is our type baselines. I just ran Note that the type baselines are a worst-case test of performance. Lots of projects wouldn't slow down that much, but really big ones with a lot of types generated across modules would resemble the type baselines. |
Pushing to a PR for performance testing. This initial cut looks extremely slow.
Fixes #32224