Skip to content

releases/cpp/v2.2.0

Choose a tag to compare

@clalancette clalancette released this 21 Oct 17:26
· 8 commits to main since this release
9b4d3e3

New features

  • ReadMessageOptions gains chained startingAt(), startingAfter(), endingAt(), and endingBefore() setters with start()/end() accessors. The startTime/endTime members, the positional constructor, and the positional readMessages(start, end) overloads are [[deprecated]]. New readMessages() and readMessages(const ReadMessageOptions&) overloads need no callback. (#1805, #1877)
  • LinearMessageView::status() reports why a read failed, including NotOpen for a reader that was never opened. (#1865)

Behavior changes

  • Default Header.library string is now mcap-cpp/X.Y.Z instead of libmcap X.Y.Z, matching the other SDKs. (#1702)
  • Default zstd level is 3 instead of 1, and chunkSize is now a threshold rather than a hard cap, matching the other writers. Chunk boundaries now match Rust, Go, and Python output. (#1804)
  • Default LZ4 compression is fast mode instead of LZ4HC level 9. CompressionLevel::Slow and Slowest still use LZ4HC. (#1807)
  • DefaultChunkSize is 1 MiB instead of 768 KiB. (#1659)
  • FileWriter throws std::system_error on a short write instead of asserting, preserving the OS error code. (#1798)
  • A read range whose end precedes its start reports InvalidMessageReadOptions instead of returning an empty view. (#1805)
  • Chunks whose decompressed size does not match the declared uncompressed size are rejected. (#1824)
  • Build: Conan 2 is required, and the lz4 Conan requirement is 1.10.0. (#1706, #1872)

Bug fixes

  • Fix a GCC -Warray-bounds false positive in the CRC32 code. (#1610)

Performance

  • Hardware-accelerated CRC32 (PCLMUL on x86_64, CRC instructions on aarch64), detected at build and run time, with CRC batched per chunk. Writes are 18% to 41% faster. (#1829)
  • The message record header is written in one call instead of six, 13% to 22% faster writes. (#1879)
  • BufferWriter reserves chunkSize in its constructor. (#1643)