Skip to content

v1.6.0 — Direct varData properties on DataReader

Choose a tag to compare

@pedrosakuma pedrosakuma released this 29 Apr 13:50
· 6 commits to main since this release
5657d43

Added

  • Direct properties for top-level <data> (varData) on {Msg}DataReader (#162): Each top-level varData field is now also exposed as a property returning the variable-length composite (e.g. VarStringEncoding) computed directly from the buffer. Zero allocation, no callback, no closure capture.

    if (NewOrderData.TryParse(buffer, out var reader))
    {
        foreach (ref readonly var leg in reader.Legs) { /* ... */ }
        var coid = reader.ClientOrderId.VarData;   // ReadOnlySpan<byte>, zero-alloc
    }

    Each access is stateless — the start offset is recomputed from the buffer by chaining the existing Skip{Group} helpers (O(1) per simple group) plus SkipData{Prev} for any prior varData. Safe regardless of access order, before/after iterating groups, and across multiple reads. For repeated reads, cache the returned value locally.

    Gating: emitted only when all top-level groups are simple (no nested groups, no group-level varData) — same gate as the foreach enumerators added in #156. Also valid for messages with only varData and no groups. When a varData name collides with a reserved member of the reader struct, the direct property is silently skipped for that field; it remains reachable via ReadGroups.

  • Benchmark GroupForeachVsCallbackBenchmarks validating the perf premise of the v1.5.0 foreach enumerator API (#156).

Full changelog: v1.5.0...v1.6.0

What's Changed

Full Changelog: v1.5.0...v1.6.0