Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 26, 2025

Reduce number of loops over Program's statements.

  1. transform_program_without_module_declaration constructed a temporary Vec and then iterated over it to generate the final Vec. Cut out the intermediate Vec.
  2. transform_statements_on_demand created a Vec and then called retain on it to filter it down. Combine the Vec construction and filtering into a single loop.

The gain from (1) is larger, but only (2) will show up in our benchmark as it takes the transform_statements_on_demand path.

Copy link
Member Author

overlookmotel commented Feb 26, 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.

@overlookmotel overlookmotel marked this pull request as ready for review February 26, 2025 12:44
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 26, 2025

CodSpeed Performance Report

Merging #9393 will not alter performance

Comparing 02-23-perf_isolated_declarations_reduce_looping_over_statements (eca808a) with main (9baa756)

Summary

✅ 33 untouched benchmarks

@overlookmotel
Copy link
Member Author

Ha! Perf actually regresses a little. I'll have to look deeper.

@overlookmotel overlookmotel marked this pull request as draft February 26, 2025 12:53
@Boshen Boshen changed the base branch from 02-23-refactor_isolated_declarations_rename_var to graphite-base/9393 February 26, 2025 13:15
@Boshen Boshen force-pushed the graphite-base/9393 branch from e4c1977 to c880481 Compare February 26, 2025 13:29
@Boshen Boshen force-pushed the 02-23-perf_isolated_declarations_reduce_looping_over_statements branch from 5a7d54e to 6836790 Compare February 26, 2025 13:29
@Boshen Boshen changed the base branch from graphite-base/9393 to main February 26, 2025 13:30
@Boshen Boshen force-pushed the 02-23-perf_isolated_declarations_reduce_looping_over_statements branch from 6836790 to df75980 Compare February 26, 2025 13:30
@overlookmotel overlookmotel force-pushed the 02-23-perf_isolated_declarations_reduce_looping_over_statements branch from df75980 to bc98ad0 Compare March 18, 2025 07:40
@overlookmotel overlookmotel force-pushed the 02-23-perf_isolated_declarations_reduce_looping_over_statements branch from bc98ad0 to eca808a Compare March 18, 2025 10:29
@overlookmotel
Copy link
Member Author

Now not negative perf effect, but not positive either. Never mind...

@overlookmotel overlookmotel deleted the 02-23-perf_isolated_declarations_reduce_looping_over_statements branch March 18, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-isolated-declarations Isolated Declarations 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.

2 participants