Skip to content

Conversation

@mattklein123
Copy link
Contributor

For logs with many fields, the fact that fb is padded and doesn't use varint encoding leads to substantial overhead. This removes that overhead. As part of this change I went a bit over the top and also implemented a custom encoder for the Log proto which allows for zero copy into the ring buffer. This is better than the previous fb implementation which encoded and then did a memcpy into the buffer.

For logs with many fields, the fact that fb is padded and doesn't
use varint encoding leads to substantial overhead. This removes
that overhead. As part of this change I went a bit over the top
and also implemented a custom encoder for the Log proto which
allows for zero copy into the ring buffer. This is better than the
previous fb implementation which encoded and then did a memcpy into
the buffer.

Signed-off-by: Matt Klein <mklein@bitdrift.io>
Signed-off-by: Matt Klein <mklein@bitdrift.io>
@mattklein123 mattklein123 marked this pull request as ready for review November 3, 2025 03:28
Signed-off-by: Matt Klein <mklein@bitdrift.io>
@mattklein123 mattklein123 merged commit f0494b4 into main Nov 3, 2025
6 checks passed
@mattklein123 mattklein123 deleted the proto branch November 3, 2025 18:44
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants