Skip to content

Support bulk write on packing containers.#9

Merged
rwindegger merged 1 commit intorwindegger:mainfrom
Neara-Software:bacek/bulk-write
Mar 8, 2026
Merged

Support bulk write on packing containers.#9
rwindegger merged 1 commit intorwindegger:mainfrom
Neara-Software:bacek/bulk-write

Conversation

@bacek
Copy link
Copy Markdown
Contributor

@bacek bacek commented Mar 5, 2026

(This sits on top of std::span packing PR#23)

Packer: bulk write via if constexpr requires store_.write()

Optimise hot emit sites (emplace_integral, emplace_combined,
pack_type(string), pack_type(vector<B>, pack_type<span<B>>)) to call store_.write(ptr, len)
in one shot instead of iterating byte-by-byte through std::copy.

Falls back to std::copy for iterators without write(), so the change is
fully backward-compatible.

Add a general CTAD deduction guide for any output_iterator that exposes
a byte value_type, complementing the existing back_insert_iterator guide.

@bacek bacek changed the title Bacek/bulk write Support bulk write on packing containers. Mar 5, 2026
@bacek bacek force-pushed the bacek/bulk-write branch from 807e369 to 2466af6 Compare March 5, 2026 23:24
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (aac15b8) to head (5d86b76).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   93.85%   93.91%   +0.06%     
==========================================
  Files           1        1              
  Lines         488      493       +5     
==========================================
+ Hits          458      463       +5     
  Misses         30       30              

☔ 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.

@rwindegger
Copy link
Copy Markdown
Owner

@bacek could you please add a unit test that covers the store_.write calls. Currently they are not called.

@bacek
Copy link
Copy Markdown
Contributor Author

bacek commented Mar 6, 2026

@bacek could you please add a unit test that covers the store_.write calls. Currently they are not called.

Fair call. Added.

@bacek bacek force-pushed the bacek/bulk-write branch 2 times, most recently from 665329c to 60f7a5d Compare March 6, 2026 12:42
@rwindegger
Copy link
Copy Markdown
Owner

Thanks for adding the unit tests. One last request please rename the test suite to match the other tests. It should be called msgpack23_bulk_write.

Optimise four hot emit sites (emplace_integral, emplace_combined,
pack_type(string), pack_type(vector<B>)) to call store_.write(ptr, len)
in one shot instead of iterating byte-by-byte through std::copy.

Falls back to std::copy for iterators without write(), so the change is
fully backward-compatible.

Add a general CTAD deduction guide for any output_iterator that exposes
a byte value_type, complementing the existing back_insert_iterator guide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bacek bacek force-pushed the bacek/bulk-write branch from 60f7a5d to 5d86b76 Compare March 7, 2026 19:22
@bacek
Copy link
Copy Markdown
Contributor Author

bacek commented Mar 7, 2026

Thanks for adding the unit tests. One last request please rename the test suite to match the other tests. It should be called msgpack23_bulk_write.

Done.

@rwindegger rwindegger merged commit 292850c into rwindegger:main Mar 8, 2026
8 checks passed
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