Skip to content

perf(schema-compiler): Remove JSON.stringify in cache key hashing#10404

Merged
ovr merged 1 commit intomasterfrom
feat/schema-compiler-remove-json-stringify
Feb 17, 2026
Merged

perf(schema-compiler): Remove JSON.stringify in cache key hashing#10404
ovr merged 1 commit intomasterfrom
feat/schema-compiler-remove-json-stringify

Conversation

@ovr
Copy link
Member

@ovr ovr commented Feb 17, 2026

… hashing

file.content is already a string, so JSON.stringify just allocates a full copy with added quotes before feeding it to MD5. Hashing the string directly eliminates ~12MB of throwaway allocations per compilation cycle (200 files x 4 phases), reduces GC pressure, and benchmarks 2.6x faster on the hashing hot path — freeing CPU cycles that were spent copying strings and collecting short-lived garbage.

@ovr ovr requested a review from a team as a code owner February 17, 2026 16:02
@github-actions github-actions bot added the javascript Pull requests that update Javascript code label Feb 17, 2026
… hashing

file.content is already a string, so JSON.stringify just allocates a
full copy with added quotes before feeding it to MD5. Hashing the
string directly eliminates ~12MB of throwaway allocations per
compilation cycle (200 files x 4 phases), reduces GC pressure, and
benchmarks 2.6x faster on the hashing hot path — freeing CPU cycles
that were spent copying strings and collecting short-lived garbage.
@ovr ovr force-pushed the feat/schema-compiler-remove-json-stringify branch from 7b7ca26 to 0cc8314 Compare February 17, 2026 16:03
@ovr ovr changed the title perf(schema-compiler): Remove unnecessary JSON.stringify in cache key… perf(schema-compiler): Remove JSON.stringify in cache key hashing Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.42%. Comparing base (884811a) to head (0cc8314).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...schema-compiler/src/compiler/DataSchemaCompiler.ts 66.66% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (884811a) and HEAD (0cc8314). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (884811a) HEAD (0cc8314)
cubesql 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10404       +/-   ##
===========================================
- Coverage   78.41%   57.42%   -20.99%     
===========================================
  Files         472      222      -250     
  Lines       92054    17368    -74686     
  Branches     3555     3555               
===========================================
- Hits        72181     9974    -62207     
+ Misses      19338     6859    -12479     
  Partials      535      535               
Flag Coverage Δ
cube-backend 57.42% <66.66%> (ø)
cubesql ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ovr ovr merged commit 6aae245 into master Feb 17, 2026
65 of 73 checks passed
@ovr ovr deleted the feat/schema-compiler-remove-json-stringify branch February 17, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant