Skip to content

de: lazily allocate for string decoding#131

Merged
djc merged 1 commit into
mainfrom
lazy-allocate
Jun 10, 2026
Merged

de: lazily allocate for string decoding#131
djc merged 1 commit into
mainfrom
lazy-allocate

Conversation

@djc

@djc djc commented Jun 5, 2026

Copy link
Copy Markdown
Owner

@vshashi01 how does this compare in your benchmarks to your previous implementation?

Depending on how common it is to have long strings, a hybrid approach (with an early return only for short inputs) might be better still, I suppose.

@vshashi01

Copy link
Copy Markdown
Contributor

This looks cleaner indeed, let me pull and run my benchmarks tomorrow and let you know

@vshashi01

Copy link
Copy Markdown
Contributor

This looks like a cleaner improvement indeed, between the original version and this version flamegraph only shows a 1% variance in execution time within the iterator.

Original (by me)

Flamegraph

image

Overall execution times for my benchmarks:

image

New version

Flamegraph

image

Overall execution times for my benchmarks

image

I think we can say it is identical within run to run variance expected in performance.

@djc djc merged commit 9c4bd18 into main Jun 10, 2026
7 checks passed
@djc djc deleted the lazy-allocate branch June 10, 2026 06:12
@djc

djc commented Jun 10, 2026

Copy link
Copy Markdown
Owner Author

Thanks for benchmarking!

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.

2 participants