perf: close the v0.7 regressions on JSON models, XRPC writes, Jetstream and CAR parsing #190

Closed
opened 2026-09-27 21:26:47 +00:00 by Grandiras · 0 comments
Owner

Part of the v0.7.0 update cycle (tracking #141). The pre-release benchmark compares v0.6.0 (7f672c0) with main (e7f9e61). It uses BenchmarkDotNet 0.15.8 on .NET 10.0.12, AMD Ryzen 5 7600X, in-process. The DAG-CBOR, LtHash, MST and identifier paths got much faster, but five paths regressed:

Benchmark v0.6.0 v0.7.0 time alloc
JsonBenchmarks.DeserializeGetTimelineResponse (50 posts) 133.4 µs / 151.6 KB 186.5 µs / 213.1 KB 1.40× 1.41×
XrpcBenchmarks.XrpcCreateRecord 2.18 µs / 4.57 KB 2.75 µs / 4.71 KB 1.26× 1.03×
JetstreamBenchmarks.ParseJetstreamCommitEvent 1.40 µs / 2.02 KB 1.71 µs / 1.56 KB 1.22× 0.77×
JsonBenchmarks.SerializePostRecord 403 ns / 944 B 468 ns / 960 B 1.16× 1.02×
CarBenchmarks.ParseSynthetic1000BlockCar / ParseCommitCar 429 / 14.7 µs 437 / 15.6 µs 1.02–1.06× 1.17–1.22×

These most likely come from this cycle's correctness features:

  • typed-identifier and AtDatetime converters, which validate every value;
  • the open-union converter, which scans ahead for $type;
  • [JsonExtensionData] on every model;
  • the stricter CAR/CID checks.

Those features stay. Their cost has to come down.

Goal: each regressed benchmark is at or better than v0.6.0, or within ~5% with the reason documented, and none of the improved benchmarks gets worse. Behaviour must not change: the drift, convention and interop tests all pass.

Part of the v0.7.0 update cycle (tracking #141). The pre-release benchmark compares v0.6.0 (`7f672c0`) with main (`e7f9e61`). It uses BenchmarkDotNet 0.15.8 on .NET 10.0.12, AMD Ryzen 5 7600X, in-process. The DAG-CBOR, LtHash, MST and identifier paths got much faster, but five paths regressed: | Benchmark | v0.6.0 | v0.7.0 | time | alloc | |---|---:|---:|---:|---:| | `JsonBenchmarks.DeserializeGetTimelineResponse` (50 posts) | 133.4 µs / 151.6 KB | 186.5 µs / 213.1 KB | **1.40×** | **1.41×** | | `XrpcBenchmarks.XrpcCreateRecord` | 2.18 µs / 4.57 KB | 2.75 µs / 4.71 KB | 1.26× | 1.03× | | `JetstreamBenchmarks.ParseJetstreamCommitEvent` | 1.40 µs / 2.02 KB | 1.71 µs / 1.56 KB | 1.22× | 0.77× | | `JsonBenchmarks.SerializePostRecord` | 403 ns / 944 B | 468 ns / 960 B | 1.16× | 1.02× | | `CarBenchmarks.ParseSynthetic1000BlockCar` / `ParseCommitCar` | 429 / 14.7 µs | 437 / 15.6 µs | 1.02–1.06× | **1.17–1.22×** | These most likely come from this cycle's correctness features: - typed-identifier and `AtDatetime` converters, which validate every value; - the open-union converter, which scans ahead for `$type`; - `[JsonExtensionData]` on every model; - the stricter CAR/CID checks. Those features stay. Their cost has to come down. **Goal:** each regressed benchmark is at or better than v0.6.0, or within ~5% with the reason documented, and none of the improved benchmarks gets worse. Behaviour must not change: the drift, convention and interop tests all pass.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Grandiras/ATProto.NET#190
No description provided.