-
-
Notifications
You must be signed in to change notification settings - Fork 563
perf(transformer/using): inline enter_statement
#9680
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
perf(transformer/using): inline enter_statement
#9680
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #9680 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
A small gain. I guess most of the cost of #9310 is iterating over statements, as we suspected. |
24ebeb0
to
e136646
Compare
6a7dcbd
to
f46312c
Compare
Merge activity
|
e136646
to
4cee555
Compare
f46312c
to
8b7d2ef
Compare
`enter_statement` is a hot path, and most `Statement`s are not `BlockStatement`s or `SwitchStatement`s, so in most cases this method does nothing. Optimize for the common "nothing to do here" case by moving as much logic as possible out of `enter_statement`, to make that function as small as possible, so it can be inlined. Mark it `#[inline]`. Hopefully now when a `Statement` is neither of the types this visitor is interested in, finding that out and exiting will just be a couple of quick checks, and won't incur the cost of a function call.
`enter_statement` is a hot path, and most `Statement`s are not `BlockStatement`s or `SwitchStatement`s, so in most cases this method does nothing. Optimize for the common "nothing to do here" case by moving as much logic as possible out of `enter_statement`, to make that function as small as possible, so it can be inlined. Mark it `#[inline]`. Hopefully now when a `Statement` is neither of the types this visitor is interested in, finding that out and exiting will just be a couple of quick checks, and won't incur the cost of a function call.
8b7d2ef
to
1b8c6b0
Compare
`enter_statement` is a hot path, and most `Statement`s are not `BlockStatement`s or `SwitchStatement`s, so in most cases this method does nothing. Optimize for the common "nothing to do here" case by moving as much logic as possible out of `enter_statement`, to make that function as small as possible, so it can be inlined. Mark it `#[inline]`. Hopefully now when a `Statement` is neither of the types this visitor is interested in, finding that out and exiting will just be a couple of quick checks, and won't incur the cost of a function call.
76df73e
to
4dc32db
Compare
1b8c6b0
to
d303ba9
Compare
enter_statement
is a hot path, and mostStatement
s are notBlockStatement
s orSwitchStatement
s, so in most cases this method does nothing.Optimize for the common "nothing to do here" case by moving as much logic as possible out of
enter_statement
, to make that function as small as possible, so it can be inlined. Mark it#[inline]
.Hopefully now when a
Statement
is neither of the types this visitor is interested in, finding that out and exiting will just be a couple of quick checks, and won't incur the cost of a function call.