-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add constructor functions for {Symbol,Node}Links #36845
Conversation
0f253b2
to
ca20613
Compare
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.
@typescript-bot perf test this |
Heya @sandersn, I've started to run the perf test suite on this PR at ca20613. You can monitor the build here. Update: The results are in! |
@sandersn Here they are:Comparison Report - master..36845
System
Hosts
Scenarios
|
side question: where is the code/repo for the benchmark suite? |
Using a constructor function like this can help node better optimize object allocation. This improves memory usage when compiling `src/compiler` from **277M** to **270M**, a nice ~3% win.
ca20613
to
434043e
Compare
BTW, I have blogged about how I discovered this, and what I think some further action might be: |
In JS, you can annotate ES5‑style constructor functions with Though I don’t know how you’d tell TypeScript that it implements an interface. |
Using a constructor function like this can help node better optimize
object allocation. This improves memory usage when compiling
src/compiler
from 277M to 270M, a nice ~3% win.Inspired by #33431, looking how far I can take this.