Skip to content

Commit 295063e

Browse files
perf(parsers): transcode protobuf wire bytes straight to proto3 JSON
Protobuf.Schema.parse and parseStream now decode protobuf bytes directly to a proto3-JSON string against the descriptor (pb_transcode), skipping the intermediate prost_reflect DynamicMessage tree + serde serialization. One pass, length-delimited values referenced in place. This is both faster and lighter: parse (50k-element catalog): ~6.0s -> ~4.6s (gap to node 5.3x -> 4.0x) whole-parse peak RSS: ~100 MB -> ~63 MB Output is identical to the previous prost-reflect serialization — a differential unit test (transcode_matches_prost_reflect) pins byte-for-value parity across every scalar type, enums, nested messages, repeated (packed + message), and maps. Suite 80/80; protobuf round-trip/advanced/stream conformance unchanged. The remaining gap to node is the JSON-string bridge into V8 (JSON.parse, kept deliberately — direct Value marshaling is slower) plus per-message bucketing.
1 parent 8fe42aa commit 295063e

2 files changed

Lines changed: 453 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ pre-`0.1.0` and the public API is unstable.
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- **`runtime:parsers` — faster, lighter Protobuf decode.** `Protobuf.Schema.parse`
12+
(and `parseStream`) now transcode protobuf wire bytes straight to proto3 JSON
13+
against the descriptor, without building an intermediate `prost_reflect`
14+
`DynamicMessage` tree. On a 50k-element catalog: parse ~6.0s → ~4.6s and
15+
whole-parse peak RSS ~100 MB → ~63 MB. Output is unchanged (a differential test
16+
pins byte-for-value parity with the previous `prost-reflect` serialization).
17+
918
### Fixed
1019

1120
- **`runtime:parsers` — TOML datetimes** now parse to RFC3339 strings instead of

0 commit comments

Comments
 (0)