Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(data_structures, ast/estree): add CodeBuffer::print_bytes_iter_unchecked method and use it in ESTree serializer #9335

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Feb 24, 2025

Optimization to ESTree serialization. Avoid allocating a String when generating indentation, and use a "trusted length" iterator instead.

This only affects generation of pretty-printed JSON, so won't show on our benchmarks, which only use compact JSON form.

…unchecked` method and use it in `ESTree` serializer
Copy link
Contributor Author

overlookmotel commented Feb 24, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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 February 24, 2025 16:55
@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Feb 24, 2025
Copy link

codspeed-hq bot commented Feb 24, 2025

CodSpeed Performance Report

Merging #9335 will not alter performance

Comparing 02-24-perf_data_structures_ast_estree_add_codebuffer_print_bytes_iter_unchecked_method_and_use_it_in_estree_serializer (207ce35) with 02-23-refactor_data_structures_codebuffer_print_str_use_vec_extend_from_slice_ (2683394)

Summary

✅ 33 untouched benchmarks

@overlookmotel overlookmotel changed the base branch from 02-23-refactor_data_structures_codebuffer_print_str_use_vec_extend_from_slice_ to graphite-base/9335 February 24, 2025 17:20
@overlookmotel
Copy link
Contributor Author

Superceded by #9337 and #9331.

@overlookmotel overlookmotel deleted the 02-24-perf_data_structures_ast_estree_add_codebuffer_print_bytes_iter_unchecked_method_and_use_it_in_estree_serializer branch February 24, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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