perf(codec): improve performance by storing next index - #870
Merged
Conversation
Member
|
thoughts on a |
JohnTitor
force-pushed
the
line-codec-next-index
branch
from
May 7, 2026 10:50
42b0f8f to
d26ccb6
Compare
Member
Author
|
After some thinking of this, it'd be a bit tricky to support such a usecase as it might cause index corruption. In d26ccb6, I tightened its availability for external use for now. Maybe we could revisit this topic if someone wants to use it. |
robjtede
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
perf
PR Checklist
Check your PR fulfills the following:
Overview
Improve performance from
O(n^2)toO(n)by storing next_index inLinesCodec. The idea is from https://docs.rs/tokio-util/latest/src/tokio_util/codec/lines_codec.rs.html.Didn't touch the changelog as it's unreleased yet.