Skip to content

perf(semantic): dereference parent_ids to slice only once#12137

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-08-perf_semantic_dereference_parent_id_s_to_slice_only_once
Jul 9, 2025
Merged

perf(semantic): dereference parent_ids to slice only once#12137
graphite-app[bot] merged 1 commit intomainfrom
07-08-perf_semantic_dereference_parent_id_s_to_slice_only_once

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 8, 2025

Small optimization to ancestors iterators. Dereference &AstNodes to a slice of parent IDs when creating iterator, rather than dereferencing repeatedly in each call to next.

In some cases compiler may have already been able to hoist the dereference out of loops, but where calling code is more complex, it may not.

@github-actions github-actions bot added A-semantic Area - Semantic C-performance Category - Solution not expected to change functional behavior, only performance labels Jul 8, 2025
Copy link
Member Author

overlookmotel commented Jul 8, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 8, 2025

CodSpeed Instrumentation Performance Report

Merging #12137 will not alter performance

Comparing 07-08-perf_semantic_dereference_parent_id_s_to_slice_only_once (6cfcb7e) with 07-08-refactor_semantic_rename_astnodeidancestorsiter_and_add_comments (c868ee3)

Summary

✅ 34 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review July 8, 2025 16:44
@overlookmotel overlookmotel requested a review from Dunqing as a code owner July 8, 2025 16:44
@overlookmotel overlookmotel marked this pull request as draft July 8, 2025 16:44
@overlookmotel overlookmotel marked this pull request as ready for review July 8, 2025 17:01
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 9, 2025
Copy link
Member

Boshen commented Jul 9, 2025

Merge activity

Small optimization to ancestors iterators. Dereference `&AstNodes` to a slice of parent IDs when creating iterator, rather than dereferencing repeatedly in each call to `next`.

In some cases compiler may have already been able to hoist the dereference out of loops, but where calling code is more complex, it may not.
@graphite-app graphite-app bot force-pushed the 07-08-refactor_semantic_rename_astnodeidancestorsiter_and_add_comments branch from 066f1ab to c868ee3 Compare July 9, 2025 02:58
@graphite-app graphite-app bot force-pushed the 07-08-perf_semantic_dereference_parent_id_s_to_slice_only_once branch from 3c6cb16 to 6cfcb7e Compare July 9, 2025 02:59
Base automatically changed from 07-08-refactor_semantic_rename_astnodeidancestorsiter_and_add_comments to main July 9, 2025 03:06
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 9, 2025
@graphite-app graphite-app bot merged commit 6cfcb7e into main Jul 9, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 07-08-perf_semantic_dereference_parent_id_s_to_slice_only_once branch July 9, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic 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