wasphin opened a new pull request, #3666:
URL: https://github.com/apache/brpc/pull/3666
### What problem does this PR solve?
Problem Summary:
Inline Redis commands and simple-string replies restart their CRLF search
from the beginning whenever more input arrives. Small fragments repeatedly
scan the same bytes and backing blocks.
### What is changed and the side effects?
Changed:
- Preserve the current backing block, offset and CR state between reads.
- Bound the reply scan by the existing allocation limit.
- Reuse inactive reply-union storage for scan state, preserving reply size.
- Cover fragmented commands, status/error replies, nested arrays, CRLF
crossing backing blocks, and scan limits.
Side effects:
- Performance effects: Previously scanned bytes and blocks are skipped on
later reads. Each command parser stores 16 bytes of scan state.
- Breaking backward compatibility: No API signature changes. Existing input
bytes must remain unchanged while the parser waits for more data.
---
### Check List:
- [x] Changes compile locally.
- [x] Added focused regression coverage.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]