Skip to content

Avoid eager error allocation when parsing named tuples - #738

Merged
liuzicheng1987 merged 2 commits into
munich-data-engineering:mainfrom
Altren:perf/lazy-error-allocation
Oct 14, 2026
Merged

liuzicheng1987 merged 2 commits into
munich-data-engineering:mainfrom
Altren:perf/lazy-error-allocation

Conversation

@Altren

@Altren Altren commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Allocate error-vector storage only when parsing encounters an error, in both regular and default-value parsing.

Add Point2d vector read benchmarks to the all-format target and CI summaries. Cover 1,000 and 1,000,000 points in JSON, Cereal, MessagePack, and YAS, with serialized size and applicable default-value and positional parsing variants.

Validated all 20 new benchmark cases and the existing JSON tests; local before/after runs show lower read times with unchanged serialized sizes.

For one million Point2d records, the read speedups on my M4 mac were:
1.38x Cereal
1.65x YAS
1.44x MessagePack (with NoFieldNames)

@Altren
Altren force-pushed the perf/lazy-error-allocation branch from cbc3661 to dd78450 Compare October 14, 2026 10:03
@Altren

Altren commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

FYI. I'm trying to make reflect-cpp work as fast as native Cereal serialization does, in my production case it is 2x slower for write and 3x slower for read.
And some can be improved for all formats, like this change. I'll create at least one more PR soon

@liuzicheng1987

Copy link
Copy Markdown
Collaborator

@Altren, great.

Thank for this. I am merging.

@liuzicheng1987
liuzicheng1987 merged commit ed67735 into munich-data-engineering:main Oct 14, 2026
176 checks passed
@Altren
Altren deleted the perf/lazy-error-allocation branch October 17, 2026 08:43
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