Skip to content

cpp: BufferWriter: Reserve chunkSize in constructor - #1643

Merged
clalancette merged 1 commit into
foxglove:mainfrom
sebastianlipponer:reserve_chunksize
Jun 4, 2026
Merged

cpp: BufferWriter: Reserve chunkSize in constructor#1643
clalancette merged 1 commit into
foxglove:mainfrom
sebastianlipponer:reserve_chunksize

Conversation

@sebastianlipponer

Copy link
Copy Markdown
Contributor

Changelog

cpp: BufferWriter: Reserve chunkSize in constructor

Docs

None

Description

The Buffer Writer at a 10M payload scale benefits the most, achieving a 2.22% reduction in median execution time. This is followed by the File Writer at 10M and 1M payload scales, which show performance gains of 0.88% and 0.73% respectively. Additionally, the Stream Writer at the 10M scale shows a measurable improvement of 0.41%.

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing to change, otherwise this looks good.

Using my own benchmarks in #1611 for comparison, on chunked, uncompressed writes, this sped things up by about 2%.

Comment thread cpp/mcap/include/mcap/writer.hpp Outdated

@clalancette clalancette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for iterating.

@clalancette
clalancette merged commit 07b87b3 into foxglove:main Jun 4, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants