-
-
Notifications
You must be signed in to change notification settings - Fork 728
perf(transformer/class-properties): return early if no private fields are found #10418
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/class-properties): return early if no private fields are found #10418
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 Instrumentation Performance ReportMerging #10418 will improve performances by 6.34%Comparing Summary
Benchmarks breakdown
|
caa8ebb to
2351230
Compare
2351230 to
f431eec
Compare
overlookmotel
left a comment
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.
Smart!
Merge activity
|
… are found (#10418) If a class or its parent classes don't have a private field, we don't need to transform the expression. Because we only transform expressions that include a private field.
f431eec to
1457e68
Compare
…mments (#10447) Follow-on after #10418. Pure refactor. `private_field_count` is accessed in both the entry and exit phases of the transform, so move that field up to be with the other fields which are in that same category. Expand the comment which explains how this optimization works. Also, when reviewing #10418, I had to trace through the logic to make sure that it wasn't possible for decreasing `private_field_count` on exit to get skipped if `is_transform_required` is `false`. Turns out it's not a problem - `is_transform_required` is always `true` if class has any private properties/methods. Add comments to clarify that.

If a class or its parent classes don't have a private field, we don't need to transform the expression. Because we only transform expressions that include a private field.