decoder: Faster decoding temp/memory streams - #76
Conversation
|
Warning Review limit reached
Next review available in: 23 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesStream decoding
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant simdjson_decode_from_stream
participant MemoryBufferHelper
participant simdjsonParser
Caller->>simdjson_decode_from_stream: decode stream
simdjson_decode_from_stream->>MemoryBufferHelper: inspect stream buffer
MemoryBufferHelper-->>simdjson_decode_from_stream: return buffer or NULL
simdjson_decode_from_stream->>simdjsonParser: parse buffer directly
simdjsonParser-->>Caller: return decoded value or JSON error
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds zero-copy decoding for unfiltered memory-backed streams on PHP 8.2+.
Changes:
- Directly parses eligible memory and temporary stream buffers.
- Falls back for filtered or file-backed streams.
- Adds filtered-stream regression tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
php_simdjson.cpp |
Implements stream fast path and buffer helper. |
src/simdjson_decoder.cpp |
Exposes padding-check helper. |
src/simdjson_decoder_defs.h |
Declares the helper. |
tests/decode_stream_memory.phpt |
Tests filtered memory streams. |
tests/decode_stream_temp.phpt |
Tests filtered temporary streams. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (SIMDJSON_SHOULD_REUSE_PARSER(len)) { | ||
| error = php_simdjson_parse_buffer(simdjson_get_reused_parser(), json, len, return_value, associative, depth); | ||
| } else { | ||
| simdjson_php_parser *simdjson_php_parser = php_simdjson_create_parser(); | ||
| error = php_simdjson_parse_buffer(simdjson_php_parser, json, len, return_value, associative, depth); |
ba536cc to
b0748ac
Compare
Summary by CodeRabbit
New Features
Bug Fixes
Tests