Skip to content

perf(transformer/regexp): avoid copying string data and temp String#10723

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

perf(transformer/regexp): avoid copying string data and temp String#10723
graphite-app[bot] merged 1 commit intomainfrom
04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Apr 30, 2025

Avoid temp String and copying string data by:

  1. Reusing existing Atom where possible, instead of copying the string data and creating a new Atom.
  2. Use format_atom! macro (introduced in feat(span): introduce format_atom! macro #10722) to avoid creating a temporary String when converting oxc_regular_expression::Pattern to a string.

Copy link
Member Author

overlookmotel commented Apr 30, 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 Apr 30, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 30, 2025

CodSpeed Instrumentation Performance Report

Merging #10723 will not alter performance

Comparing 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ (8e902a5) with main (b01cb45)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel changed the base branch from 04-30-feat_span_introduce_format_atom_macro to graphite-base/10723 April 30, 2025 14:10
@overlookmotel overlookmotel force-pushed the 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ branch from 7d86281 to 5e58742 Compare April 30, 2025 14:23
@overlookmotel overlookmotel changed the base branch from graphite-base/10723 to 04-30-feat_span_introduce_format_atom_macro April 30, 2025 14:24
@overlookmotel overlookmotel changed the base branch from 04-30-feat_span_introduce_format_atom_macro to graphite-base/10723 April 30, 2025 21:01
@overlookmotel overlookmotel force-pushed the 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ branch from 5e58742 to 12d1f44 Compare April 30, 2025 21:41
@overlookmotel overlookmotel changed the base branch from graphite-base/10723 to 04-30-perf_transformer_jsx_skip_creating_temp_string_ April 30, 2025 21:41
@overlookmotel overlookmotel marked this pull request as ready for review April 30, 2025 21:42
@overlookmotel overlookmotel requested a review from Dunqing as a code owner April 30, 2025 21:42
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_jsx_skip_creating_temp_string_ branch 2 times, most recently from acc7c22 to e96f818 Compare May 1, 2025 02:10
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ branch from 12d1f44 to 2f226b0 Compare May 1, 2025 02:10
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label May 1, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented May 1, 2025

Merge activity

…#10723)

Avoid temp `String` and copying string data by:

1. Reusing existing `Atom` where possible, instead of copying the string data and creating a new `Atom`.
2. Use `format_atom!` macro (introduced in #10722) to avoid creating a temporary `String` when converting `oxc_regular_expression::Pattern` to a string.
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_jsx_skip_creating_temp_string_ branch from e96f818 to 2256918 Compare May 1, 2025 06:40
@graphite-app graphite-app bot force-pushed the 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ branch from 2f226b0 to 8e902a5 Compare May 1, 2025 06:41
Base automatically changed from 04-30-perf_transformer_jsx_skip_creating_temp_string_ to main May 1, 2025 06:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 1, 2025
@graphite-app graphite-app bot merged commit 8e902a5 into main May 1, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 04-30-perf_transformer_regexp_avoid_copying_string_data_and_temp_string_ branch May 1, 2025 06:54
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.

1 participant