Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 10, 2025

Small optimization to codegen. It's not possible for a property to be both computed and shorthand, so only check if !shorthand once, and skip all other key-related code if shorthand == true.

(came across this while working on #13638)

Copy link
Member Author


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-codegen Area - Code Generation C-performance Category - Solution not expected to change functional behavior, only performance labels Sep 10, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 10, 2025

CodSpeed Instrumentation Performance Report

Merging #13659 will not alter performance

Comparing 09-10-perf_codegen_reduce_branches_when_printing_objectproperty_and_bindingproperty_ (641b252) with main (d3be692)1

Summary

✅ 37 untouched benchmarks

Footnotes

  1. No successful run was found on main (641b252) during the generation of this report, so d3be692 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel marked this pull request as ready for review September 10, 2025 16:10
Copilot AI review requested due to automatic review settings September 10, 2025 16:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the codegen performance by reducing redundant branching in ObjectProperty and BindingProperty implementations. The key insight is that a property cannot be both computed and shorthand simultaneously, allowing for more efficient conditional logic.

  • Consolidates duplicate computed checks within the !shorthand branch
  • Eliminates redundant branching by nesting computed conditions inside !shorthand checks
  • Maintains identical output behavior while reducing code paths

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@overlookmotel overlookmotel self-assigned this Sep 10, 2025
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Sep 11, 2025
Copy link
Member

Boshen commented Sep 11, 2025

Merge activity

…ndingProperty` (#13659)

Small optimization to codegen. It's not possible for a property to be both `computed` and `shorthand`, so only check `if !shorthand` once, and skip all other key-related code if `shorthand == true`.

(came across this while working on #13638)
@graphite-app graphite-app bot force-pushed the 09-10-perf_codegen_reduce_branches_when_printing_objectproperty_and_bindingproperty_ branch from 60861f0 to 641b252 Compare September 11, 2025 00:12
@graphite-app graphite-app bot merged commit 641b252 into main Sep 11, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 09-10-perf_codegen_reduce_branches_when_printing_objectproperty_and_bindingproperty_ branch September 11, 2025 00:17
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 11, 2025
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