| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
TypeScript Bot (@typescript-bot) perf test |
Sorry, something went wrong.
|
Heya Ron Buckton (@rbuckton), I've started to run the perf test suite on this PR at 70cdafc. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Ron Buckton (@rbuckton)
CompilerComparison Report - main..51682
System
Hosts
Scenarios
TSServerComparison Report - main..51682
System
Hosts
Scenarios
StartupComparison Report - main..51682
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
| tests/cases/user/axios-src/axios-src | ||
| tests/cases/user/prettier/prettier | ||
| .eslintcache | ||
| *v8.log No newline at end of file |
There was a problem hiding this comment.
a question, if I may, what kind of tools you were using to investigate those things? I imagine that in the case of Nodes the issue was already known for some time but I wonder how I could test those things in my libraries.
Sorry, something went wrong.
There was a problem hiding this comment.
I have an internal tool I wrote to analyze log files generated by various V8 commandline options.
Sorry, something went wrong.
There was a problem hiding this comment.
Mateusz Burzyński (@Andarist) One open source tool that might be of interest is https://github.com/thlorenz/deoptigate
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good to me*, just a few detail questions.
*Looking at the functionality changes -- I'll take your word that the performance is better.
Sorry, something went wrong.
|
TypeScript Bot (@typescript-bot) perf test Running again after rebasing against main in case something changed. |
Sorry, something went wrong.
|
Heya Ron Buckton (@rbuckton), I've started to run the perf test suite on this PR at f476065. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Ron Buckton (@rbuckton)
CompilerComparison Report - main..51682
System
Hosts
Scenarios
TSServerComparison Report - main..51682
System
Hosts
Scenarios
StartupComparison Report - main..51682
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
I'm going to temporarily borrow this PR to see if the benefit I saw locally in #51788 was a knock-on effect from the changes in this PR, since #51788 isn't having the same impact in benchmarks as I was expecting. If it does improve, I'll leave it in and close the other one. |
Sorry, something went wrong.
|
TypeScript Bot (@typescript-bot) perf test |
Sorry, something went wrong.
|
Heya Ron Buckton (@rbuckton), I've started to run the perf test suite on this PR at 5f84fc6. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Ron Buckton (@rbuckton)
CompilerComparison Report - main..51682
System
Hosts
Scenarios
TSServerComparison Report - main..51682
System
Hosts
Scenarios
StartupComparison Report - main..51682
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
| } | ||
| // falls through | ||
| case SyntaxKind.ThisKeyword: | ||
| // TODO: Why use `isExpression` here? both Identifier and ThisKeyword are expressions. |
There was a problem hiding this comment.
IIRC this in a type position wasn't an expression, but was still parsed as a ThisKeyword for a period of time.
Sorry, something went wrong.
|
System info: Node 19.2.0, Windows 10.0.22623, AMD64 Family 25 Model 33 Stepping 0 AuthenticAMD ~3701 Mhz Project scale: Projects in scope: 75 Projects built: 71 Aggregate Files: 64824 Aggregate Lines of Library: 716308 Aggregate Lines of Definitions: 8345732 Aggregate Lines of TypeScript: 216245 Aggregate Lines of JavaScript: 0 Aggregate Lines of JSON: 40878 Aggregate Lines of Other: 0 Perf result: 5.0.0-dev.20221207 => npm:@typescript-deploys/pr-build@5.0.0-pr-51682-13 Aggregate Identifiers: 9923117 Aggregate Symbols: 8689294 => 8689301 Aggregate Types: 998455 => 998526 Aggregate Instantiations: 6990544 Aggregate Memory used: 2633329K => 2685920K Aggregate Assignability cache size: 428849 Aggregate Identity cache size: 53133 Aggregate Subtype cache size: 49022 Aggregate Strict subtype cache size: 37922 Aggregate I/O Read time: 0.72s Aggregate Parse time: 2.23s => 2.32s Aggregate ResolveModule time: 2.79s => 2.78s Aggregate ResolveTypeReference time: 0.10s => 0.11s Aggregate Program time: 10.15s => 10.23s Aggregate Bind time: 1.08s => 10.7s Aggregate Check time: 35.31s => 35.43s Aggregate transformTime time: 5.92s => 5.81s Aggregate Source Map time: 0.83s => 0.81s Aggregate commentTime time: 1.19s => 0.16s Aggregate printTime time: 19.76s => 19.60s Aggregate Emit time: 19.82s => 19.68s Aggregate I/O Write time: 2.81s => 2.90s Config file parsing time: 0.32s Up-to-date check time: 0.01s Build time: 90.30s => 90.60s |
Sorry, something went wrong.
| CallExpression, | ||
| CallSignatureDeclaration, | ||
| CaseBlock, | ||
| canHaveLocals, CaseBlock, |
There was a problem hiding this comment.
There's no lint rule for this, but these should be columns.
Hopefully one day we can get formatting automated...
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
There's no lint rule for this, but these should be columns.
Hopefully one day we can get formatting automated...
I've also noticed that Organize Imports seems to be sorting __String to the end rather than the start.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, that's: #51733
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
We have a number of places in our codebase where we optionally attach properties to a Node. While a common practice in JS, this can sometimes have negative consequences with regards to runtime performance. Most modern JavaScript engines use Inline Caches (ICs) to optimize code paths, primarily when reading or writing to properties on objects, or to global variables.
Ideally, we want property ICs to be "monomorphic", such that they only ever see a single object shape (or "map" in V8 parlance) as "monomorphic" property ICs provide the fastest lookups. A "polymorphic" IC has slightly worse performance since it shifts from a one-to-one lookup to a short list of "map"-> property entries. If a new "map" is encountered once a polymorphic IC has around four entries, V8 will shift to a "megamporphic" IC. "Megamorphic" property ICs are the worst in terms of performance, as V8 essentially gives up on fast property access and relies on slow property lookups (there is still a cache, but it is cyclical: repeated property lookups for the same "map" will be fast but will age out as new "maps" are encountered).
Monomorphism isn't always possible, especially when accessing properties like .kind. However, in cases where we have branched on .kind, we should endeavor to ensure that further property accesses within that branch remain monomorphic, or at least polymorphic.
One way to achieve this is to ensure the shape of every Node is stable relative to its kind. This has the following implications:
There is a trade-off for these changes, however. Pre-defining potentially unused properties on a Node increases the memory footprint. As such, if the memory cost becomes too severe, we may want to investigate removing properties from some Node subtypes where the value can be trivially recomputed from source or moved into a cache like NodeLinks or EmitNode.