Skip to content

perf(ast): assume serde_json output is valid UTF8 string#8928

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string
Feb 8, 2025
Merged

perf(ast): assume serde_json output is valid UTF8 string#8928
graphite-app[bot] merged 1 commit intomainfrom
02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 6, 2025

serde_json produces valid UTF8 output, so when converting serialized JSON to string, there's no need to check the output for UTF8 validity. Skipping that check is a speed-up.

Additionally, add a method to test the serializer without producing any output, and use it in conformance. This will hopefully speed up conformance a little.

Copy link
Member Author


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-ast Area - AST C-performance Category - Solution not expected to change functional behavior, only performance labels Feb 6, 2025
@overlookmotel overlookmotel marked this pull request as ready for review February 6, 2025 17:12
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2025

CodSpeed Performance Report

Merging #8928 will create unknown performance changes

Comparing 02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string (fcfc274) with main (b191390)

Summary

🆕 33 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 24.9 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 68.3 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 723.7 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.6 µs N/A
🆕 lexer[antd.js] N/A 22 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.5 ms N/A
🆕 lexer[checker.ts] N/A 13.2 ms N/A
🆕 lexer[pdf.mjs] N/A 3.6 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.6 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 2.8 s N/A
🆕 mangler[antd.js] N/A 16.2 ms N/A
🆕 mangler[react.development.js] N/A 298 µs N/A
🆕 mangler[typescript.js] N/A 39.9 ms N/A
🆕 minifier[antd.js] N/A 158.6 ms N/A
🆕 minifier[react.development.js] N/A 1.6 ms N/A
🆕 minifier[typescript.js] N/A 272.2 ms N/A
🆕 estree[checker.ts] N/A 191 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 87.4 µs N/A
🆕 parser[antd.js] N/A 106.7 ms N/A
... ... ... ... ...

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

@overlookmotel overlookmotel force-pushed the 02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string branch from 84d97ab to d674a68 Compare February 6, 2025 17:56
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Feb 8, 2025
Copy link
Member

Boshen commented Feb 8, 2025

Merge activity

  • Feb 8, 10:10 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 8, 10:10 AM EST: A user added this pull request to the Graphite merge queue.
  • Feb 8, 10:25 AM EST: A user merged this pull request with the Graphite merge queue.

`serde_json` produces valid UTF8 output, so when converting serialized JSON to string, there's no need to check the output for UTF8 validity. Skipping that check is a speed-up.

Additionally, add a method to test the serializer without producing any output, and use it in conformance. This will hopefully speed up conformance a little.
@graphite-app graphite-app bot force-pushed the 02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string branch from d674a68 to fcfc274 Compare February 8, 2025 15:19
@graphite-app graphite-app bot merged commit fcfc274 into main Feb 8, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 02-06-perf_ast_assume_serde_json_output_is_valid_utf8_string branch February 8, 2025 15:25
Dunqing pushed a commit that referenced this pull request Feb 10, 2025
`serde_json` produces valid UTF8 output, so when converting serialized JSON to string, there's no need to check the output for UTF8 validity. Skipping that check is a speed-up.

Additionally, add a method to test the serializer without producing any output, and use it in conformance. This will hopefully speed up conformance a little.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-ast Area - AST 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