Skip to content

perf(parser): avoid work in parse_function_id#11321

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-27-perf_parser_avoid_work_in_parse_function_id_
May 27, 2025
Merged

perf(parser): avoid work in parse_function_id#11321
graphite-app[bot] merged 1 commit intomainfrom
05-27-perf_parser_avoid_work_in_parse_function_id_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 27, 2025

Small optimization. It's unnecessary to update ctx and then set it back again unless the next token is a binding identifier (function has a name). Move that work into the branch for which it's needed, so that logic is skipped for anonymous functions.

@github-actions github-actions bot added the A-parser Area - Parser label May 27, 2025
Copy link
Member Author

overlookmotel commented May 27, 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 C-performance Category - Solution not expected to change functional behavior, only performance label May 27, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 27, 2025

CodSpeed Instrumentation Performance Report

Merging #11321 will create unknown performance changes

Comparing 05-27-perf_parser_avoid_work_in_parse_function_id_ (552a977) with 05-26-perf_parser_remove_branch_parsing_class_elements (6eda38a)

Summary

🆕 38 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[RadixUIAdoptionSection.jsx] N/A 132.3 µs N/A
🆕 codegen[binder.ts] N/A 4.8 ms N/A
🆕 codegen[cal.com.tsx] N/A 38.9 ms N/A
🆕 codegen[react.development.js] N/A 2.2 ms N/A
🆕 formatter[RadixUIAdoptionSection.jsx] N/A 300.1 µs N/A
🆕 formatter[binder.ts] N/A 18.9 ms N/A
🆕 formatter[cal.com.tsx] N/A 142.8 ms N/A
🆕 formatter[react.development.js] N/A 9.2 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 21.9 µs N/A
🆕 lexer[binder.ts] N/A 961.2 µs N/A
🆕 lexer[cal.com.tsx] N/A 6 ms N/A
🆕 lexer[react.development.js] N/A 397.2 µs N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.8 ms N/A
🆕 linter[binder.ts] N/A 148.9 ms N/A
🆕 linter[cal.com.tsx] N/A 1.3 s N/A
🆕 linter[react.development.js] N/A 54.6 ms N/A
🆕 mangler[RadixUIAdoptionSection.jsx] N/A 14.2 µs N/A
🆕 mangler[binder.ts] N/A 798.5 µs N/A
🆕 mangler[cal.com.tsx] N/A 3 ms N/A
🆕 mangler[react.development.js] N/A 283.5 µs N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label May 27, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented May 27, 2025

Merge activity

Small optimization. It's unnecessary to update `ctx` and then set it back again unless the next token is a binding identifier (function has a name). Move that work into the branch for which it's needed, so that logic is skipped for anonymous functions.
@graphite-app graphite-app bot force-pushed the 05-26-perf_parser_remove_branch_parsing_class_elements branch from 6d83ca7 to 6eda38a Compare May 27, 2025 15:18
@graphite-app graphite-app bot force-pushed the 05-27-perf_parser_avoid_work_in_parse_function_id_ branch from 41aebd6 to 552a977 Compare May 27, 2025 15:19
Base automatically changed from 05-26-perf_parser_remove_branch_parsing_class_elements to main May 27, 2025 15:25
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 27, 2025
@graphite-app graphite-app bot merged commit 552a977 into main May 27, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 05-27-perf_parser_avoid_work_in_parse_function_id_ branch May 27, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser 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