Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 5, 2025

Small perf optimization. Make a fast path for printing an empty object literal.

Previously we branched twice on self.is_empty() (unpredicable branches), and did an unnecessary call to print_list for empty objects. This change should speed up printing both empty objects, and objects which do have properties.

Copy link
Member Author

overlookmotel commented Nov 5, 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 the A-codegen Area - Code Generation label Nov 5, 2025
@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Nov 5, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 5, 2025 12:05
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 5, 2025

CodSpeed Performance Report

Merging #15316 will not alter performance

Comparing 09-15-perf_codegen_reduce_branches_printing_objectpattern_ (e5c138e) with main (977a6a0)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on 09-15-fix_codegen_print_space_before_bindingrestelement_in_objectpattern_ (557836d) during the generation of this report, so main (977a6a0) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
Copy link
Member

Boshen commented Nov 5, 2025

Merge activity

Small perf optimization. Make a fast path for printing an empty object literal.

Previously we branched twice on `self.is_empty()` (unpredicable branches), and did an unnecessary call to `print_list` for empty objects. This change should speed up printing both empty objects, and objects which do have properties.
@graphite-app graphite-app bot force-pushed the 09-15-fix_codegen_print_space_before_bindingrestelement_in_objectpattern_ branch from 557836d to 020aa4f Compare November 5, 2025 12:09
@graphite-app graphite-app bot force-pushed the 09-15-perf_codegen_reduce_branches_printing_objectpattern_ branch from e5c138e to ab4b12b Compare November 5, 2025 12:10
Base automatically changed from 09-15-fix_codegen_print_space_before_bindingrestelement_in_objectpattern_ to main November 5, 2025 12:15
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
@graphite-app graphite-app bot merged commit ab4b12b into main Nov 5, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 09-15-perf_codegen_reduce_branches_printing_objectpattern_ branch November 5, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation 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