Skip to content

perf(transformer/regexp): do not store parsed regexp#10748

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-30-perf_transformer_regexp_do_not_store_parsed_regexp
May 2, 2025
Merged

perf(transformer/regexp): do not store parsed regexp#10748
graphite-app[bot] merged 1 commit intomainfrom
04-30-perf_transformer_regexp_do_not_store_parsed_regexp

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 1, 2025

Regexp transform do not store the parsed regexp Pattern in AST.

This has 2 effects:

  1. When the regexp does need to be transformed, it avoids converting the Pattern back to a string again later on in the transform.
  2. When the regexp doesn't need to be transformed, it makes the RegExpLiteral faster to print in oxc_codegen, again because it avoids converting the Pattern back to a string.

Only the 1st will show an effect in our benchmarks, because transformer benchmark doesn't include codegen.

Copy link
Member Author

overlookmotel commented May 1, 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 A-transformer Area - Transformer / Transpiler C-performance Category - Solution not expected to change functional behavior, only performance labels May 1, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 1, 2025

CodSpeed Instrumentation Performance Report

Merging #10748 will not alter performance

Comparing 04-30-perf_transformer_regexp_do_not_store_parsed_regexp (dec3c80) with main (63f02a8)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review May 1, 2025 11:11
@overlookmotel overlookmotel requested a review from Dunqing as a code owner May 1, 2025 11:11
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 1, 2025
Copy link
Member

Boshen commented May 1, 2025

Merge activity

  • May 1, 9:45 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@graphite-app
Copy link
Contributor

graphite-app bot commented May 1, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_inline_enter_expression_ branch from 469b98c to c4c41eb Compare May 1, 2025 14:16
graphite-app bot pushed a commit that referenced this pull request May 1, 2025
Regexp transform do not store the parsed regexp `Pattern` in AST.

This has 2 effects:

1. When the regexp does need to be transformed, it avoids converting the `Pattern` back to a string again later on in the transform.
2. When the regexp doesn't need to be transformed, it makes the `RegExpLiteral` faster to print in `oxc_codegen`, again because it avoids converting the `Pattern` back to a string.

Only the 1st will show an effect in our benchmarks, because transformer benchmark doesn't include codegen.
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_do_not_store_parsed_regexp branch from d4650a3 to f3b0a9d Compare May 1, 2025 14:17
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 1, 2025
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 2, 2025
Regexp transform do not store the parsed regexp `Pattern` in AST.

This has 2 effects:

1. When the regexp does need to be transformed, it avoids converting the `Pattern` back to a string again later on in the transform.
2. When the regexp doesn't need to be transformed, it makes the `RegExpLiteral` faster to print in `oxc_codegen`, again because it avoids converting the `Pattern` back to a string.

Only the 1st will show an effect in our benchmarks, because transformer benchmark doesn't include codegen.
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_inline_enter_expression_ branch from c4c41eb to fc90298 Compare May 2, 2025 01:05
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_do_not_store_parsed_regexp branch from f3b0a9d to dec3c80 Compare May 2, 2025 01:05
Base automatically changed from 04-30-perf_transformer_regexp_inline_enter_expression_ to main May 2, 2025 01:12
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 2, 2025
@graphite-app graphite-app bot merged commit dec3c80 into main May 2, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 04-30-perf_transformer_regexp_do_not_store_parsed_regexp branch May 2, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler 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