Skip to content

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Apr 15, 2025

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.

Copy link
Member Author

Dunqing commented Apr 15, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-performance Category - Solution not expected to change functional behavior, only performance labels Apr 15, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 15, 2025

CodSpeed Instrumentation Performance Report

Merging #10418 will improve performances by 6.34%

Comparing 04-15-perf_transformer_class-properties_return_early_if_no_private_fields_are_found (f431eec) with main (bb8a078)

Summary

⚡ 3 improvements
✅ 33 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
transformer[antd.js] 52.4 ms 49.8 ms +5.21%
transformer[checker.ts] 23.3 ms 22 ms +6.34%
transformer[pdf.mjs] 10.6 ms 10.1 ms +4.44%

Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 16, 2025
Copy link
Member

overlookmotel commented Apr 16, 2025

Merge activity

  • Apr 16, 6:53 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Apr 16, 6:53 AM EDT: overlookmotel added this pull request to the Graphite merge queue.
  • Apr 16, 11:13 AM UTC: The Graphite merge queue couldn't merge this PR because it timed out.
  • Apr 16, 7:15 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

… 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.
@graphite-app graphite-app bot force-pushed the 04-15-perf_transformer_class-properties_return_early_if_no_private_fields_are_found branch from f431eec to 1457e68 Compare April 16, 2025 10:53
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 16, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 16, 2025
@Dunqing Dunqing merged commit ebe3496 into main Apr 16, 2025
5 checks passed
@Dunqing Dunqing deleted the 04-15-perf_transformer_class-properties_return_early_if_no_private_fields_are_found branch April 16, 2025 13:26
graphite-app bot pushed a commit that referenced this pull request Apr 16, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants