Skip to content

refactor(transformer/styled-components): do not allocate temp data into arena#12198

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena
Jul 11, 2025
Merged

refactor(transformer/styled-components): do not allocate temp data into arena#12198
graphite-app[bot] merged 1 commit intomainfrom
07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 10, 2025

Only strings which are part of AST should be stored in arena. Use String instead of StringBuilder for the temp string here.

Ideally we'd use a scratch allocator for temp data to avoid allocations, but we don't have that yet. oxc-project/backlog#121

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jul 10, 2025
Copy link
Member Author

overlookmotel commented Jul 10, 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 July 10, 2025 16:13
@overlookmotel overlookmotel requested a review from Dunqing as a code owner July 10, 2025 16:13
@graphite-app graphite-app bot changed the base branch from 07-10-perf_transformer_styled-components_generate_file_path_hash_in_inlinestring_ to graphite-base/12198 July 10, 2025 16:13
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 10, 2025

CodSpeed Instrumentation Performance Report

Merging #12198 will not alter performance

Comparing 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena (5ad62cd) with main (e93e4c8)

Summary

✅ 34 untouched benchmarks

@graphite-app graphite-app bot force-pushed the graphite-base/12198 branch from 1dee729 to daf6087 Compare July 10, 2025 16:22
@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 9769412 to 5ee93d4 Compare July 10, 2025 16:22
@graphite-app graphite-app bot changed the base branch from graphite-base/12198 to main July 10, 2025 16:22
@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 5ee93d4 to b20fd6e Compare July 10, 2025 16:22
@Dunqing Dunqing force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from b20fd6e to 3824b83 Compare July 11, 2025 05:13
@Dunqing Dunqing changed the base branch from main to graphite-base/12198 July 11, 2025 05:21
@Dunqing Dunqing force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 3824b83 to 7b6417c Compare July 11, 2025 05:21
@Dunqing Dunqing changed the base branch from graphite-base/12198 to 07-11-fix_transformer_styled-components_template_literal_expressions_order_is_wrong_after_minification July 11, 2025 05:21
@Dunqing Dunqing force-pushed the 07-11-fix_transformer_styled-components_template_literal_expressions_order_is_wrong_after_minification branch from 0928f4a to bdccba7 Compare July 11, 2025 07:09
@Dunqing Dunqing force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 7b6417c to 20854b0 Compare July 11, 2025 07:09
@Dunqing Dunqing force-pushed the 07-11-fix_transformer_styled-components_template_literal_expressions_order_is_wrong_after_minification branch from bdccba7 to 00cd55e Compare July 11, 2025 07:40
@Dunqing Dunqing force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 20854b0 to 7dc1a91 Compare July 11, 2025 07:40
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
Copy link
Member Author

overlookmotel commented Jul 11, 2025

Merge activity

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
@overlookmotel overlookmotel changed the base branch from 07-11-fix_transformer_styled-components_template_literal_expressions_order_is_wrong_after_minification to graphite-base/12198 July 11, 2025 09:39
@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 7dc1a91 to caa2e11 Compare July 11, 2025 09:55
@graphite-app graphite-app bot force-pushed the graphite-base/12198 branch from 00cd55e to e93e4c8 Compare July 11, 2025 09:55
@graphite-app graphite-app bot changed the base branch from graphite-base/12198 to main July 11, 2025 09:56
@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from caa2e11 to 2690913 Compare July 11, 2025 09:56
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
…to arena (#12198)

Only strings which are part of AST should be stored in arena. Use `String` instead of `StringBuilder` for the temp string here.

Ideally we'd use a scratch allocator for temp data to avoid allocations, but we don't have that yet. oxc-project/backlog#121
@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 2690913 to 5ad62cd Compare July 11, 2025 10:09
@graphite-app graphite-app bot merged commit 5ad62cd into main Jul 11, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch July 11, 2025 10:17
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant