Skip to content

perf: serialize human-readable sizes without allocating - #216

Merged
robjtede merged 1 commit into
masterfrom
t3/explore-optimization-opportunities
Nov 25, 2026
Merged

robjtede merged 1 commit into
masterfrom
t3/explore-optimization-opportunities

Conversation

@robjtede

Copy link
Copy Markdown
Member

Summary

  • Use Serializer::collect_str to serialize human-readable ByteSize values without allocating a temporary String.
  • Keep binary serialization unchanged.

Testing

  • just test — passed.
  • Serde survey benchmarks ran before and after the change. Results varied between runs, so the speedup is uncertain.

@codspeed

codspeed Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 2.9%

⚡ 1 improved benchmark
❌ 1 (👁 1) regressed benchmark
✅ 28 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory serialize_json 136 B 128 B +6.25%
👁 Walltime serialize_cbor 63 ns 71 ns -11.27%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing t3/explore-optimization-opportunities (e13e872) with master (dc05480)

Open in CodSpeed

@robjtede
robjtede added this pull request to the merge queue Nov 25, 2026
Merged via the queue into master with commit dd34f8c Nov 25, 2026
13 checks passed
@robjtede
robjtede deleted the t3/explore-optimization-opportunities branch November 25, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant