Skip to content

Conversation

@copybara-service
Copy link

Fasttable: added support for varint fields.

This involved a significant refactoring of the shared code in cardinality.h.

This also makes a significant change to the design: we now allow the fast decoder to handle arena allocation fallback paths, whereas before the plan was to delegate these to the MiniTable decoder. While writing this CL, I realized that the previous plan was not feasible, at least not if we ever want to handle streaming decode. The problem is that a delimited field could require allocating memory, but if allocation fails in a subsequent buffer, we cannot back up to the previous buffer to fall back to the MiniTable decoder.

If we use preserve_most for fallback paths, then handling allocation failure in the fast decoder should not be too bad.

This involved a significant refactoring of the shared code in `cardinality.h`.

This also makes a significant change to the design: we now allow the fast decoder to handle arena allocation fallback paths, whereas before the plan was to delegate these to the MiniTable decoder.  While writing this CL, I realized that the previous plan was not feasible, at least not if we ever want to handle streaming decode.  The problem is that a delimited field could require allocating memory, but if allocation fails in a subsequent buffer, we cannot back up to the previous buffer to fall back to the MiniTable decoder.

If we use `preserve_most` for fallback paths, then handling allocation failure in the fast decoder should not be too bad.

PiperOrigin-RevId: 768510853
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

Auto-closing Copybara pull request

@github-actions github-actions bot closed this Nov 3, 2025
@github-actions github-actions bot deleted the test_768510853 branch November 3, 2025 10:08
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