You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Pipeline Blueprint:** Use `Schema.define<'T> |> Schema.construct ctor |> Schema.field ... |> Schema.build` to define symmetric mappings. This is the current stable DSL.
37
+
-**Pipeline Blueprint:** Use `Schema.record ctor |> Schema.field ... |> Schema.build` to define symmetric mappings. This is the current stable DSL.
38
38
39
39
## 5. Current Findings & Edge Cases
40
-
-**Do not collapse `Schema.define` and `Schema.construct` without proving it compiles across the repo.** A direct `Schema.define makeCtor` style was attempted and rejected because F# either mis-inferred record targets when field names overlapped (`Id`, `Name`) or collapsed the constructor state to `obj`.
40
+
-**Keep `Schema.record` as the stable entry point.** Earlier experiments that split record initialization into separate entry points or tried to collapse everything into one differently shaped helper ran into F# inference failures around overlapping record fields such as `Id` and `Name`.
41
41
-**Keep `Json.compile` explicit.** Hiding compilation inside `serialize`/`deserialize` would either recompile on each call or require implicit caching, which is poor UX for a performance-oriented library.
42
42
-**Explicit nested/custom schemas currently use `Schema.fieldWith`.** Auto-resolution exists for primitives, lists, and arrays only. Future work may rename this, but the explicit-schema distinction is currently meaningful.
43
43
-**Benchmarks should use the same DSL as tests and docs.** Avoid introducing parallel schema-definition styles unless the repo deliberately adopts a second public API.
|`small-message`|`526.5 ns`|`715.0 ns`|`641.6 ns`|`907.5 ns`|`CodecMapper` still leads both directions on the tiny-message case. |
113
-
|`person-batch-25`|`8.33 us`|`7.37 us`|`24.29 us`|`18.22 us`| Medium nested workloads still trail `STJ`, but remain comfortably ahead of `Newtonsoft.Json`. |
114
-
|`person-batch-250`|`84.95 us`|`69.09 us`|`229.36 us`|`168.44 us`| Larger nested batches still trail `STJ`, but stay ahead of `Newtonsoft.Json`. |
115
-
|`escaped-articles-20`|`43.45 us`|`30.85 us`|`98.00 us`|`59.33 us`| String-heavy payloads remain a clear weak spot, especially on decode. |
116
-
|`telemetry-500`|`413.04 us`|`298.93 us`|`516.87 us`|`513.80 us`| Numeric-heavy decode is still roughly tied with `STJ`, while serialize trails. |
117
-
|`person-batch-25-unknown-fields`|`9.05 us`|`7.85 us`|`30.93 us`|`25.00 us`| Unknown-field decode is still in range, but not especially close to `STJ`. |
112
+
|`small-message`|`441.8 ns`|`627.1 ns`|`644.6 ns`|`889.1 ns`|`CodecMapper` still leads both directions on the tiny-message case. |
113
+
|`person-batch-25`|`7.96 us`|`7.29 us`|`27.13 us`|`20.84 us`| Medium nested workloads still trail `STJ`, but remain ahead of `Newtonsoft.Json` on decode. |
114
+
|`person-batch-250`|`83.89 us`|`71.53 us`|`294.50 us`|`217.70 us`| Larger nested batches still trail `STJ`, and the decode gap widened on this run. |
115
+
|`escaped-articles-20`|`45.97 us`|`34.71 us`|`115.38 us`|`66.25 us`| String-heavy payloads remain a clear weak spot, especially on decode. |
116
+
|`telemetry-500`|`421.70 us`|`317.53 us`|`559.46 us`|`556.73 us`| Numeric-heavy decode is still roughly tied with `STJ`, while serialize trails. |
117
+
|`person-batch-25-unknown-fields`|`8.56 us`|`7.63 us`|`34.38 us`|`29.37 us`| Unknown-field decode is still in range, but not especially close to `STJ`. |
118
118
119
119
Those numbers are machine-specific. Compare ratios and workload shape more than the absolute values.
0 commit comments