You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "kamcheungting-db (via GitHub)" <gi...@apache.org> on 2026/06/30 23:07:36 UTC
[PR] feat(logging): zero-allocation format->dispatch path (LogRecord view) [iceberg-cpp]
kamcheungting-db opened a new pull request, #795:
URL: https://github.com/apache/iceberg-cpp/pull/795
Makes the logging **format → dispatch path allocation-free**, addressing the zero-allocation request on #725. Builds on the merged logging blocks (#722/#723/#724).
**What changed**
- Sinks now receive a non-owning `LogRecord` (`{ level, std::string_view message, std::source_location, std::span<const LogAttribute> }`) instead of an owned `LogMessage&&`. The views are valid only for the duration of the `Log()` call.
- The function-style `Log()` / `FormatAndEmit` format into a reused per-thread `FormatBuffer()` via `std::format_to` (`clear()` keeps capacity), so logging performs **no heap allocation after the buffer warms up**. `std::format_to` with a `std::format_string` keeps compile-time format-string checking.
- `LogMessage`/`Builder` stay as the owned/retained type and convert implicitly to `LogRecord`, so `logger->Log(builder.Build())` is unchanged.
- Synchronous sinks (`CerrLogger`, no-op) read the view directly with no allocation; retaining sinks (the test `CapturingLogger`) deep-copy into an owned `LogMessage`, so existing assertions are unaffected.
**Why now**: every production sink consumes the record synchronously, so the owned-`std::string` model wasn't buying anything in practice — better to change the interface before external adoption.
**Tests**: new `logging_zero_alloc_test` (its own binary; global `operator new` counter + a negative control proving the probe works) asserts the format→dispatch path does 0 heap allocations after warmup. Existing logging tests pass unchanged; ASan/TSan clean.
**Out of scope (documented)**: `CerrLogger`'s own rendered-line `std::format` and `ICEBERG_LOG_RUNTIME_FMT` (vformat) still allocate.
The open macro/spdlog/registry PRs (#725/#726/#737) will be rebased onto this interface once it lands.
This pull request and its description were written by Isaac.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat(logging): zero-allocation format->dispatch path (LogRecord view) [iceberg-cpp]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #795:
URL: https://github.com/apache/iceberg-cpp/pull/795#issuecomment-5548160951
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat(logging): zero-allocation format->dispatch path (LogRecord view) [iceberg-cpp]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #795: feat(logging): zero-allocation format->dispatch path (LogRecord view)
URL: https://github.com/apache/iceberg-cpp/pull/795
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat(logging): zero-allocation format->dispatch path (LogRecord view) [iceberg-cpp]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #795:
URL: https://github.com/apache/iceberg-cpp/pull/795#issuecomment-5459249000
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org