diff --git a/docs/docs/performance.md b/docs/docs/performance.md index 5554899c..03fc88b4 100644 --- a/docs/docs/performance.md +++ b/docs/docs/performance.md @@ -10,7 +10,7 @@ The [example JSON serializer](https://github.com/eiriktsarpalis/PolyType/tree/ma The [benchmark suite](https://github.com/eiriktsarpalis/PolyType/blob/main/tests/PolyType.Benchmarks/JsonBenchmark.cs) compares nine payloads, from a single integer to megabytes of JSON, across six serialization and five deserialization configurations. All use default JSON settings, cached metadata/converters, and equivalent valid inputs. Setup checks that every serialization path produces equivalent JSON and that all deserialization paths round-trip correctly. -All **99 measurements** and all eight charts were refreshed on **October 27, 2026**, using the same benchmark job settings as the previous Windows run. +All **99 measurements** and all eight charts were refreshed on **October 28, 2026**, using the same benchmark job settings as the previous run. Measurements used an Apple M4 Pro (14 cores, Arm64), macOS 27.0.1 (26A434), BenchmarkDotNet 0.16.0-preview.2, and .NET 11.0.0-rc.3.26522.148 with SDK `11.0.100-rc.3.26522.148`, Release configuration, and concurrent server GC. BenchmarkDotNet could not elevate process priority on this host. Host and runtime details are included in the exported dataset. @@ -24,15 +24,15 @@ The comparison includes STJ reflection, STJ source-generated metadata, PolyType ### Serialization -With source-generated shapes, PolyType's collection and object writers took **1.08-1.46x** the time of the PolyType fast path baseline. Its small- and large-POCO writers took **1.34x and 1.10x** the time of STJ's fast path, respectively, while using **35% and 12% less elapsed time** than STJ metadata. The `List` writer took **1.29x** the time of STJ metadata; the other payloads used less elapsed time. These comparisons describe measured means on this host, not cross-platform guarantees or significance tests. +With source-generated shapes, PolyType's collection and object writers took **1.06-1.34x** the time of the PolyType fast path baseline. Its small- and large-POCO writers took **1.35x and 1.11x** the time of STJ's fast path, respectively, while using **35% and 11% less elapsed time** than STJ metadata. The `List` writer took **1.09x** the time of STJ metadata; the `int[]` writer was effectively tied. These comparisons describe measured means on this host, not cross-platform guarantees or significance tests. Both shape-driven PolyType configurations and the fast-path baseline allocated no managed memory in these warmed, reused-buffer serialization cases. This does not include producing a new output string or byte array for each call. ### Deserialization -With source-generated shapes, the PolyType reader used **7-52% less elapsed time than STJ metadata** across eight of the nine payloads. The exception was `List`, which took **1.02x** the time of STJ metadata. For the large POCO, CITM batch, and large-object batch, its times were **0.98x, 0.98x, and 0.97x** the PolyType fast path baseline, respectively. +With source-generated shapes, the PolyType reader used **6-52% less elapsed time than STJ metadata** across seven of the nine payloads. The `int[]` reader was effectively tied (**0.99x**), while `List` took **1.03x** the time of STJ metadata. For the large POCO, CITM batch, and large-object batch, its times were **1.07x, 1.09x, and 1.08x** the PolyType fast path baseline, respectively. -For the CITM batch, the PolyType reader with source-generated shapes allocated **2.80 MiB per read**, compared with **5.73 MiB** for STJ metadata and **10.80 MiB** for the PolyType fast path baseline. +For the CITM batch, the PolyType reader with source-generated shapes allocated **2.80 MiB per read**, compared with **5.73 MiB** for both STJ metadata and the PolyType fast path baseline. For the small POCO, both shape-driven PolyType readers and the fast-path baseline allocated **440 B per read**. The benchmark measures complete serializers, not the isolated cost of a visitor or member accessor. Differences include serializer algorithms and collection construction as well as dispatch and member access through type shapes. Shape and converter construction are excluded from the timed operations. diff --git a/docs/images/performance/deserialize-collections.svg b/docs/images/performance/deserialize-collections.svg index 2b524520..ae05c79b 100644 --- a/docs/images/performance/deserialize-collections.svg +++ b/docs/images/performance/deserialize-collections.svg @@ -22,65 +22,65 @@ int[]: 256 elements STJ reflection - -1.00x | 3.17 us | 3.20 KiB + +1.00x | 3.22 us | 3.20 KiB STJ source-gen metadata - - -1.02x | 3.23 us | 3.20 KiB + + +1.00x | 3.23 us | 3.20 KiB PolyType reflection - - -0.98x | 3.12 us | 1.02 KiB + + +0.99x | 3.19 us | 1.02 KiB PolyType source-gen - - -0.95x | 3.00 us | 1.02 KiB + + +1.00x | 3.20 us | 1.02 KiB PolyType fast path - - -0.98x | 3.12 us | 3.20 KiB + + +0.95x | 3.06 us | 3.20 KiB List<int>: 256 elements STJ reflection - -1.00x | 3.09 us | 2.18 KiB + +1.00x | 3.06 us | 2.18 KiB STJ source-gen metadata - - -0.97x | 3.00 us | 2.18 KiB + + +0.99x | 3.04 us | 2.18 KiB PolyType reflection - - -1.02x | 3.15 us | 2.18 KiB + + +1.04x | 3.18 us | 2.18 KiB PolyType source-gen - - -1.00x | 3.07 us | 2.18 KiB + + +1.02x | 3.11 us | 2.18 KiB PolyType fast path - - -0.94x | 2.90 us | 2.18 KiB + + +0.98x | 2.99 us | 2.18 KiB Dictionary<string, int>: 64 entries STJ reflection - -1.00x | 2.66 us | 6.52 KiB + +1.00x | 2.58 us | 6.52 KiB STJ source-gen metadata - - -0.96x | 2.56 us | 6.52 KiB + + +1.01x | 2.61 us | 6.52 KiB PolyType reflection - - -0.90x | 2.40 us | 6.52 KiB + + +0.94x | 2.41 us | 6.52 KiB PolyType source-gen - - -0.89x | 2.36 us | 6.52 KiB + + +0.95x | 2.44 us | 6.52 KiB PolyType fast path - - -0.90x | 2.39 us | 6.52 KiB + + +0.99x | 2.55 us | 6.52 KiB diff --git a/docs/images/performance/deserialize-megabyte.svg b/docs/images/performance/deserialize-megabyte.svg index f89d994f..71dfbb10 100644 --- a/docs/images/performance/deserialize-megabyte.svg +++ b/docs/images/performance/deserialize-megabyte.svg @@ -22,44 +22,44 @@ CITM event catalogs: 5 catalogs, 2.39 MiB JSON STJ reflection - -1.00x | 7.77 ms | 5.73 MiB + +1.00x | 7.97 ms | 5.73 MiB STJ source-gen metadata - - -1.02x | 7.94 ms | 5.73 MiB + + +0.97x | 7.77 ms | 5.73 MiB PolyType reflection - - -0.78x | 6.08 ms | 2.80 MiB + + +0.72x | 5.75 ms | 2.80 MiB PolyType source-gen - - -0.76x | 5.93 ms | 2.80 MiB + + +0.72x | 5.75 ms | 2.80 MiB PolyType fast path - - -0.78x | 6.04 ms | 10.80 MiB + + +0.66x | 5.29 ms | 5.73 MiB Large POCO array: 4,096 records, 2.64 MiB JSON STJ reflection - -1.00x | 7.84 ms | 8.59 MiB + +1.00x | 7.18 ms | 8.59 MiB STJ source-gen metadata - - -0.91x | 7.16 ms | 8.50 MiB + + +0.99x | 7.14 ms | 8.50 MiB PolyType reflection - - -0.75x | 5.90 ms | 6.94 MiB + + +0.82x | 5.89 ms | 6.94 MiB PolyType source-gen - - -0.76x | 5.95 ms | 6.94 MiB + + +0.83x | 5.93 ms | 6.94 MiB PolyType fast path - - -0.78x | 6.12 ms | 12.37 MiB + + +0.76x | 5.49 ms | 8.19 MiB diff --git a/docs/images/performance/deserialize-pocos.svg b/docs/images/performance/deserialize-pocos.svg index e6e2adc0..9ea5dcd3 100644 --- a/docs/images/performance/deserialize-pocos.svg +++ b/docs/images/performance/deserialize-pocos.svg @@ -22,44 +22,44 @@ Small POCO: 4 properties, parameterized constructor STJ reflection - -1.00x | 571.07 ns | 1016 B + +1.00x | 563.10 ns | 1016 B STJ source-gen metadata - - -0.99x | 567.49 ns | 992 B + + +1.02x | 572.22 ns | 992 B PolyType reflection - - -0.50x | 282.93 ns | 440 B + + +0.50x | 281.74 ns | 440 B PolyType source-gen - - -0.47x | 271.25 ns | 440 B + + +0.48x | 272.00 ns | 440 B PolyType fast path - - -0.44x | 249.03 ns | 576 B + + +0.42x | 233.84 ns | 440 B Large POCO: 24 properties, nested objects and collections STJ reflection - -1.00x | 1.83 us | 2.58 KiB + +1.00x | 1.81 us | 2.58 KiB STJ source-gen metadata - - -1.02x | 1.87 us | 2.55 KiB + + +1.00x | 1.80 us | 2.55 KiB PolyType reflection - - -0.79x | 1.45 us | 1.72 KiB + + +0.79x | 1.43 us | 1.72 KiB PolyType source-gen - - -0.79x | 1.44 us | 1.72 KiB + + +0.78x | 1.41 us | 1.72 KiB PolyType fast path - - -0.80x | 1.46 us | 3.06 KiB + + +0.73x | 1.33 us | 2.02 KiB diff --git a/docs/images/performance/deserialize-primitives.svg b/docs/images/performance/deserialize-primitives.svg index c53091e5..21ef3994 100644 --- a/docs/images/performance/deserialize-primitives.svg +++ b/docs/images/performance/deserialize-primitives.svg @@ -22,44 +22,44 @@ int: 42 STJ reflection - -1.00x | 22.81 ns | 0 B + +1.00x | 20.69 ns | 0 B STJ source-gen metadata - - -1.00x | 22.80 ns | 0 B + + +1.10x | 22.74 ns | 0 B PolyType reflection - - -0.66x | 15.01 ns | 0 B + + +0.72x | 14.95 ns | 0 B PolyType source-gen - - -0.66x | 15.11 ns | 0 B + + +0.73x | 15.10 ns | 0 B PolyType fast path - - -0.66x | 15.04 ns | 0 B + + +0.73x | 15.12 ns | 0 B string: Hello, PolyType! STJ reflection - -1.00x | 33.36 ns | 56 B + +1.00x | 34.30 ns | 56 B STJ source-gen metadata - - -0.98x | 32.69 ns | 56 B + + +0.98x | 33.70 ns | 56 B PolyType reflection - - -0.83x | 27.70 ns | 56 B + + +0.80x | 27.29 ns | 56 B PolyType source-gen - - -0.77x | 25.77 ns | 56 B + + +0.79x | 27.03 ns | 56 B PolyType fast path - - -0.80x | 26.76 ns | 56 B + + +0.87x | 29.91 ns | 56 B diff --git a/docs/images/performance/results.json b/docs/images/performance/results.json index 613e4c1e..6dc0f1be 100644 --- a/docs/images/performance/results.json +++ b/docs/images/performance/results.json @@ -1,5 +1,5 @@ { - "measured_on": "2026-10-27", + "measured_on": "2026-10-28", "host": { "BenchmarkDotNetCaption": "BenchmarkDotNet", "BenchmarkDotNetVersion": "0.16.0-preview.2", @@ -26,30 +26,32 @@ "method": "StjReflection", "job": "JsonDeserializeBenchmark\u003CCitmCatalog[], JsonBenchmarkWitness\u003E.Deserialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 7748428.7109375, - 7763582.03125, - 7746141.2734375, - 7899821.2890625, - 7742049.15625, - 7756707.359375, - 7739401.046875, - 7767743.1640625, - 7717688.4765625, - 7796507.4921875 - ], - "Mean": 7767807, - "StandardError": 16062.27467635016, - "StandardDeviation": 50793.3723805104, + 7973605.46875, + 7942715.5, + 7867222, + 8030154.953125, + 7937438.15625, + 7967462.25, + 7974309.890625, + 8041973.953125, + 7960329.421875, + 7998925.140625, + 7921666.671875, + 8064056.640625 + ], + "Mean": 7973321.670572917, + "StandardError": 15855.756552799385, + "StandardDeviation": 54925.95188378338, "ConfidenceInterval": { - "N": 10, - "Mean": 7767807, - "StandardError": 16062.27467635016, + "N": 12, + "Mean": 7973321.670572917, + "StandardError": 15855.756552799385, "Level": 12, - "Margin": 76792.33113774349, - "Lower": 7691014.668862256, - "Upper": 7844599.331137744 + "Margin": 70351.66419960141, + "Lower": 7902970.006373315, + "Upper": 8043673.334772519 } }, "allocated_bytes": 6006912 @@ -60,31 +62,32 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CCitmCatalog[], JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 7882410.8125, - 7858071.609375, - 7898347.65625, - 7914857.75, - 7909451.5, - 7853228.1875, - 7898478.1875, - 7856040.0390625, - 8168599.609375, - 8195700.1953125, - 7955260.0859375 - ], - "Mean": 7944585.966619318, - "StandardError": 36590.31416258641, - "StandardDeviation": 121356.34303852636, + 7785733.3984375, + 7829901.3671875, + 7808927.40625, + 7747077.8046875, + 7703386.390625, + 7743917.96875, + 7767438.8046875, + 7802377.9296875, + 7737045.8984375, + 7782717.125, + 7748410.484375, + 7752756.8359375 + ], + "Mean": 7767474.284505208, + "StandardError": 10292.539250603548, + "StandardDeviation": 35654.40184188448, "ConfidenceInterval": { - "N": 11, - "Mean": 7944585.966619318, - "StandardError": 36590.31416258641, + "N": 12, + "Mean": 7767474.284505208, + "StandardError": 10292.539250603548, "Level": 12, - "Margin": 167835.88727043255, - "Lower": 7776750.079348885, - "Upper": 8112421.853889751 + "Margin": 45667.78398170072, + "Lower": 7721806.500523508, + "Upper": 7813142.068486908 } }, "allocated_bytes": 6006912 @@ -97,30 +100,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 6033282.2265625, - 5998313.4765625, - 6029035.15625, - 6042637.375, - 6012833.328125, - 6035524.4140625, - 6225051.4296875, - 6218771.484375, - 6185652.34375, - 6089462.2421875, - 6037001.953125, - 6019754.2265625 - ], - "Mean": 6077276.638020833, - "StandardError": 24038.611272235165, - "StandardDeviation": 83272.19213381846, + 5749327.4765625, + 5729933.59375, + 5763777.6640625, + 5730780.921875, + 5734552.734375, + 5736319.9921875, + 5770982.09375, + 5749139.6484375, + 5756326.8203125, + 5734447.9140625, + 5746729.171875, + 5762346.03125 + ], + "Mean": 5747055.338541667, + "StandardError": 4054.576065923265, + "StandardDeviation": 14045.463498663665, "ConfidenceInterval": { "N": 12, - "Mean": 6077276.638020833, - "StandardError": 24038.611272235165, + "Mean": 5747055.338541667, + "StandardError": 4054.576065923265, "Level": 12, - "Margin": 106658.82150861244, - "Lower": 5970617.816512221, - "Upper": 6183935.4595294455 + "Margin": 17990.070225391635, + "Lower": 5729065.268316275, + "Upper": 5765045.4087670585 } }, "allocated_bytes": 2932144 @@ -133,29 +136,29 @@ "statistics": { "N": 11, "OriginalValues": [ - 5971155.6015625, - 5972132.1640625, - 5963500.328125, - 5946136.0703125, - 5916437.1796875, - 5919193.359375, - 5936665.0390625, - 5921475.5859375, - 5904142.90625, - 5910749.3515625, - 5918371.421875 - ], - "Mean": 5934541.727982954, - "StandardError": 7517.7788446642835, - "StandardDeviation": 24933.65168462294, + 5745370.765625, + 5753169.921875, + 5744954.421875, + 5752776.6953125, + 5750453.453125, + 5746952.1484375, + 5747640.9453125, + 5764831.7109375, + 5720061.8515625, + 5771456.0546875, + 5741476.2421875 + ], + "Mean": 5749013.1100852275, + "StandardError": 3952.3087745406942, + "StandardDeviation": 13108.325260780837, "ConfidenceInterval": { "N": 11, - "Mean": 5934541.727982954, - "StandardError": 7517.7788446642835, + "Mean": 5749013.1100852275, + "StandardError": 3952.3087745406942, "Level": 12, - "Margin": 34483.253603415615, - "Lower": 5900058.474379539, - "Upper": 5969024.98158637 + "Margin": 18128.820840243498, + "Lower": 5730884.289244984, + "Upper": 5767141.930925471 } }, "allocated_bytes": 2932144 @@ -166,35 +169,34 @@ "method": "PolyTypeFastPath", "job": "JsonDeserializeBenchmark\u003CCitmCatalog[], JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 6023397.7890625, - 6049256.5078125, - 6047582.6875, - 6063794.265625, - 6065383.140625, - 6033482.09375, - 6007943.6875, - 6052754.8828125, - 6056268.5546875, - 6063277.34375, - 6028920.25, - 6044110.3515625 - ], - "Mean": 6044680.962890625, - "StandardError": 5182.488870960583, - "StandardDeviation": 17952.668068327992, + 5271636.390625, + 5254735.6796875, + 5365155.921875, + 5269423.5, + 5297867.1875, + 5293778.6484375, + 5264884.4375, + 5282123.3671875, + 5330536.1328125, + 5264350.9140625, + 5252654.296875 + ], + "Mean": 5286104.225142046, + "StandardError": 10423.055983722721, + "StandardDeviation": 34569.365866876964, "ConfidenceInterval": { - "N": 12, - "Mean": 6044680.962890625, - "StandardError": 5182.488870960583, + "N": 11, + "Mean": 5286104.225142046, + "StandardError": 10423.055983722721, "Level": 12, - "Margin": 22994.596035445542, - "Lower": 6021686.36685518, - "Upper": 6067675.55892607 + "Margin": 47809.45146642707, + "Lower": 5238294.773675619, + "Upper": 5333913.676608473 } }, - "allocated_bytes": 11329040 + "allocated_bytes": 6005520 }, { "operation": "Deserialize", @@ -204,30 +206,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3021.1078338623047, - 2811.821617126465, - 2800.715129852295, - 2769.2453079223633, - 2605.8920249938965, - 2532.747901916504, - 2544.8029861450195, - 2532.6897315979004, - 2549.7895889282227, - 2560.5969429016113, - 2562.3526573181152, - 2655.3827934265137 - ], - "Mean": 2662.2620429992676, - "StandardError": 44.831773481350986, - "StandardDeviation": 155.3018189262379, + 2592.4134254455566, + 2544.2608184814453, + 2613.8456649780273, + 2563.077293395996, + 2535.255115509033, + 2571.152530670166, + 2579.888027191162, + 2562.258243560791, + 2578.5255432128906, + 2606.581687927246, + 2584.8585777282715, + 2611.091453552246 + ], + "Mean": 2578.6006984710693, + "StandardError": 7.24778022695851, + "StandardDeviation": 25.107047190370455, "ConfidenceInterval": { "N": 12, - "Mean": 2662.2620429992676, - "StandardError": 44.831773481350986, + "Mean": 2578.6006984710693, + "StandardError": 7.24778022695851, "Level": 12, - "Margin": 198.9176525844018, - "Lower": 2463.3443904148658, - "Upper": 2861.1796955836694 + "Margin": 32.158251107196314, + "Lower": 2546.442447363873, + "Upper": 2610.758949578266 } }, "allocated_bytes": 6672 @@ -238,31 +240,32 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CDictionary\u003CString, Int32\u003E, JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 2684.0659790039062, - 2525.077980041504, - 2487.0177879333496, - 2510.744255065918, - 2518.0223808288574, - 2526.5707969665527, - 2585.4382514953613, - 2688.074905395508, - 2657.7140502929688, - 2506.0694999694824, - 2506.6593475341797 - ], - "Mean": 2563.2232031388717, - "StandardError": 23.25390381883707, - "StandardDeviation": 77.12447387809513, + 2632.1705169677734, + 2591.590244293213, + 2594.5515632629395, + 2557.401657104492, + 2670.517288208008, + 2589.3775634765625, + 2548.2187271118164, + 2640.1642150878906, + 2569.7733573913574, + 2651.6267471313477, + 2662.7025604248047, + 2554.1671104431152 + ], + "Mean": 2605.188462575277, + "StandardError": 12.797417171874148, + "StandardDeviation": 44.33155349468087, "ConfidenceInterval": { - "N": 11, - "Mean": 2563.2232031388717, - "StandardError": 23.25390381883707, + "N": 12, + "Mean": 2605.188462575277, + "StandardError": 12.797417171874148, "Level": 12, - "Margin": 106.66318858575072, - "Lower": 2456.560014553121, - "Upper": 2669.886391724622 + "Margin": 56.78187556045369, + "Lower": 2548.4065870148233, + "Upper": 2661.9703381357303 } }, "allocated_bytes": 6672 @@ -275,30 +278,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 2370.1213188171387, - 2344.630874633789, - 2414.527576446533, - 2432.114601135254, - 2431.7421913146973, - 2471.8642234802246, - 2363.830726623535, - 2353.595413208008, - 2488.8709411621094, - 2452.0489387512207, - 2367.4190826416016, - 2366.715591430664 - ], - "Mean": 2404.7901233037314, - "StandardError": 14.390566648412577, - "StandardDeviation": 49.85038516951351, + 2466.4786643981934, + 2401.2697525024414, + 2395.6174850463867, + 2466.0183601379395, + 2377.4890899658203, + 2376.9928588867188, + 2448.4658241271973, + 2374.4055404663086, + 2367.1841621398926, + 2432.1010932922363, + 2419.6530990600586, + 2431.595802307129 + ], + "Mean": 2413.1059776941934, + "StandardError": 10.397200999873947, + "StandardDeviation": 36.01696077657522, "ConfidenceInterval": { "N": 12, - "Mean": 2404.7901233037314, - "StandardError": 14.390566648412577, + "Mean": 2413.1059776941934, + "StandardError": 10.397200999873947, "Level": 12, - "Margin": 63.850646868841, - "Lower": 2340.9394764348904, - "Upper": 2468.6407701725725 + "Margin": 46.13216600060312, + "Lower": 2366.97381169359, + "Upper": 2459.2381436947967 } }, "allocated_bytes": 6672 @@ -309,30 +312,32 @@ "method": "PolyTypeSourceGen", "job": "JsonDeserializeBenchmark\u003CDictionary\u003CString, Int32\u003E, JsonBenchmarkWitness\u003E.Deserialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 2349.884033203125, - 2327.508289337158, - 2241.793788909912, - 2369.5812225341797, - 2387.457847595215, - 2351.7580032348633, - 2458.247661590576, - 2355.7238578796387, - 2362.4135665893555, - 2379.1685104370117 - ], - "Mean": 2358.3536781311036, - "StandardError": 17.016807983527045, - "StandardDeviation": 53.8118717336825, + 2445.3887939453125, + 2409.7626991271973, + 2524.357318878174, + 2437.3227767944336, + 2460.838794708252, + 2438.2402114868164, + 2504.300750732422, + 2383.950393676758, + 2390.4012031555176, + 2484.6793785095215, + 2435.6184005737305, + 2391.4006538391113 + ], + "Mean": 2442.1884479522705, + "StandardError": 13.073239521914251, + "StandardDeviation": 45.28703014294588, "ConfidenceInterval": { - "N": 10, - "Mean": 2358.3536781311036, - "StandardError": 17.016807983527045, + "N": 12, + "Mean": 2442.1884479522705, + "StandardError": 13.073239521914251, "Level": 12, - "Margin": 81.3558714384619, - "Lower": 2276.997806692642, - "Upper": 2439.7095495695653 + "Margin": 58.00569362830491, + "Lower": 2384.1827543239656, + "Upper": 2500.1941415805754 } }, "allocated_bytes": 6672 @@ -343,31 +348,32 @@ "method": "PolyTypeFastPath", "job": "JsonDeserializeBenchmark\u003CDictionary\u003CString, Int32\u003E, JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 2389.317035675049, - 2395.752269744873, - 2413.5333671569824, - 2389.0345878601074, - 2404.7088623046875, - 2391.2933654785156, - 2388.197105407715, - 2376.085121154785, - 2394.0227813720703, - 2392.395496368408, - 2399.88533782959 - ], - "Mean": 2394.0204845775256, - "StandardError": 2.9310841351151455, - "StandardDeviation": 9.721306305140308, + 2534.949462890625, + 2507.4575729370117, + 2617.9610862731934, + 2521.4055366516113, + 2548.713363647461, + 2556.8405799865723, + 2510.6469802856445, + 2507.1849822998047, + 2607.760429382324, + 2495.607376098633, + 2531.560260772705, + 2609.5802001953125 + ], + "Mean": 2545.805652618408, + "StandardError": 12.575981976891324, + "StandardDeviation": 43.56447947809252, "ConfidenceInterval": { - "N": 11, - "Mean": 2394.0204845775256, - "StandardError": 2.9310841351151455, + "N": 12, + "Mean": 2545.805652618408, + "StandardError": 12.575981976891324, "Level": 12, - "Margin": 13.44457181470031, - "Lower": 2380.5759127628253, - "Upper": 2407.465056392226 + "Margin": 55.79937217579782, + "Lower": 2490.00628044261, + "Upper": 2601.605024794206 } }, "allocated_bytes": 6672 @@ -378,29 +384,32 @@ "method": "StjReflection", "job": "JsonDeserializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Deserialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 9, + "N": 12, "OriginalValues": [ - 22.859832882881165, - 22.69103255867958, - 22.78556302189827, - 22.77110144495964, - 22.59620651602745, - 22.89617681503296, - 22.888723760843277, - 22.87786576151848, - 22.883839905261993 - ], - "Mean": 22.80559362967809, - "StandardError": 0.03495268783458528, - "StandardDeviation": 0.10485806350375584, + 20.68965509533882, + 20.712386816740036, + 20.69491520524025, + 20.717501640319824, + 20.71465429663658, + 20.690982550382614, + 20.733702927827835, + 20.722219079732895, + 20.683500915765762, + 20.65982422232628, + 20.644402772188187, + 20.658547669649124 + ], + "Mean": 20.693524432679016, + "StandardError": 0.008123439312804553, + "StandardDeviation": 0.02814041924395978, "ConfidenceInterval": { - "N": 9, - "Mean": 22.80559362967809, - "StandardError": 0.03495268783458528, + "N": 12, + "Mean": 20.693524432679016, + "StandardError": 0.008123439312804553, "Level": 12, - "Margin": 0.17620717499562433, - "Lower": 22.629386454682464, - "Upper": 22.981800804673714 + "Margin": 0.03604353237748009, + "Lower": 20.657480900301536, + "Upper": 20.729567965056496 } }, "allocated_bytes": 0 @@ -413,30 +422,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 22.774815559387207, - 22.741947323083878, - 22.763125598430634, - 22.75996282696724, - 22.659900307655334, - 22.723304718732834, - 22.75977036356926, - 22.67472693324089, - 23.02289754152298, - 22.915797919034958, - 22.94520166516304, - 22.86081513762474 - ], - "Mean": 22.800188824534416, - "StandardError": 0.03229398218541793, - "StandardDeviation": 0.11186963584773613, + 22.801395505666733, + 22.86089462041855, + 22.850070148706436, + 22.816166281700134, + 22.630080580711365, + 22.69347506761551, + 22.724286943674088, + 22.701285779476166, + 22.724686831235886, + 22.679157555103302, + 22.712287813425064, + 22.708609700202942 + ], + "Mean": 22.741866402328014, + "StandardError": 0.020951243453989497, + "StandardDeviation": 0.07257723628810932, "ConfidenceInterval": { "N": 12, - "Mean": 22.800188824534416, - "StandardError": 0.03229398218541793, + "Mean": 22.741866402328014, + "StandardError": 0.020951243453989497, "Level": 12, - "Margin": 0.14328773167088737, - "Lower": 22.656901092863528, - "Upper": 22.943476556205304 + "Margin": 0.0929602342928843, + "Lower": 22.64890616803513, + "Upper": 22.8348266366209 } }, "allocated_bytes": 0 @@ -447,31 +456,32 @@ "method": "PolyTypeReflection", "job": "JsonDeserializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Deserialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 14.983983099460602, - 14.989778399467468, - 15.01481980085373, - 15.065142273902893, - 15.039602905511856, - 15.03978419303894, - 15.03928005695343, - 14.985012501478195, - 14.989621937274933, - 14.988282054662704, - 14.991273492574692 - ], - "Mean": 15.011507337743586, - "StandardError": 0.008845874237677444, - "StandardDeviation": 0.029338445789047186, + 15.130973100662231, + 15.048642963171005, + 15.104714781045914, + 14.823130041360855, + 14.928733319044113, + 14.97596874833107, + 14.91030552983284, + 14.878260612487793, + 14.920538932085037, + 14.86266776919365, + 14.90123075246811, + 14.881736308336258 + ], + "Mean": 14.947241904834906, + "StandardError": 0.028311731241057958, + "StandardDeviation": 0.09807471391949489, "ConfidenceInterval": { - "N": 11, - "Mean": 15.011507337743586, - "StandardError": 0.008845874237677444, + "N": 12, + "Mean": 14.947241904834906, + "StandardError": 0.028311731241057958, "Level": 12, - "Margin": 0.040575086203586484, - "Lower": 14.970932251539999, - "Upper": 15.052082423947173 + "Margin": 0.12561856651542871, + "Lower": 14.821623338319476, + "Upper": 15.072860471350335 } }, "allocated_bytes": 0 @@ -484,30 +494,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 15.101669996976852, - 15.186725795269012, - 15.069499611854553, - 15.076760202646255, - 15.143840283155441, - 15.190954029560089, - 15.097728610038757, - 15.11162519454956, - 15.20801955461502, - 15.102844685316086, - 14.947600662708282, - 15.058985590934753 - ], - "Mean": 15.108021184802055, - "StandardError": 0.02043863837496938, - "StandardDeviation": 0.07080152020594792, + 15.116597831249237, + 15.122373282909393, + 15.152864784002304, + 15.094513699412346, + 15.162505209445953, + 15.062933787703514, + 15.10072623193264, + 15.060089528560638, + 15.064002320170403, + 15.047580629587173, + 15.086326122283936, + 15.0917898863554 + ], + "Mean": 15.096858609467745, + "StandardError": 0.010536588254176185, + "StandardDeviation": 0.03649981238933321, "ConfidenceInterval": { "N": 12, - "Mean": 15.108021184802055, - "StandardError": 0.02043863837496938, + "Mean": 15.096858609467745, + "StandardError": 0.010536588254176185, "Level": 12, - "Margin": 0.09068581614915552, - "Lower": 15.0173353686529, - "Upper": 15.198707000951211 + "Margin": 0.046750624367803785, + "Lower": 15.050107985099942, + "Upper": 15.143609233835548 } }, "allocated_bytes": 0 @@ -520,30 +530,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 14.940110325813293, - 14.84881341457367, - 14.995147794485092, - 15.06500193476677, - 15.097399562597275, - 15.064602106809616, - 15.069197863340378, - 15.034991025924683, - 15.06664726138115, - 15.068385750055313, - 15.1014986038208, - 15.08721336722374 - ], - "Mean": 15.036584084232649, - "StandardError": 0.02155536193646313, - "StandardDeviation": 0.0746699640989808, + 15.113356202840805, + 15.068292617797852, + 15.156437933444977, + 15.133416920900345, + 15.145860612392426, + 15.11302962899208, + 15.15108346939087, + 15.117719769477844, + 15.146927297115326, + 15.146623075008392, + 15.100574731826782, + 15.032205730676651 + ], + "Mean": 15.118793999155363, + "StandardError": 0.010806794301888432, + "StandardDeviation": 0.0374358335956332, "ConfidenceInterval": { "N": 12, - "Mean": 15.036584084232649, - "StandardError": 0.02155536193646313, + "Mean": 15.118793999155363, + "StandardError": 0.010806794301888432, "Level": 12, - "Margin": 0.09564069551680832, - "Lower": 14.94094338871584, - "Upper": 15.132224779749457 + "Margin": 0.04794952301827514, + "Lower": 15.070844476137088, + "Upper": 15.166743522173638 } }, "allocated_bytes": 0 @@ -556,30 +566,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3167.6457748413086, - 3153.4080505371094, - 3157.942928314209, - 3174.7547760009766, - 3179.392021179199, - 3153.83211517334, - 3192.470073699951, - 3175.419330596924, - 3172.840751647949, - 3157.8013076782227, - 3183.450698852539, - 3213.820137023926 - ], - "Mean": 3173.5648304621377, - "StandardError": 5.103628708583293, - "StandardDeviation": 17.679488452466796, + 3191.6298866271973, + 3188.786666870117, + 3239.000160217285, + 3207.8121490478516, + 3198.988594055176, + 3209.249336242676, + 3208.1195487976074, + 3223.9575386047363, + 3244.9227981567383, + 3196.8863792419434, + 3219.0462760925293, + 3270.2345848083496 + ], + "Mean": 3216.552826563517, + "StandardError": 7.038724519018842, + "StandardDeviation": 24.382856974842884, "ConfidenceInterval": { "N": 12, - "Mean": 3173.5648304621377, - "StandardError": 5.103628708583293, + "Mean": 3216.552826563517, + "StandardError": 7.038724519018842, "Level": 12, - "Margin": 22.64469512445346, - "Lower": 3150.9201353376843, - "Upper": 3196.209525586591 + "Margin": 31.230675250755404, + "Lower": 3185.322151312762, + "Upper": 3247.7835018142723 } }, "allocated_bytes": 3280 @@ -592,30 +602,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3182.1034774780273, - 3185.93851852417, - 3195.3635215759277, - 3224.5939559936523, - 3191.9150352478027, - 3167.337261199951, - 3300.1009635925293, - 3255.1422119140625, - 3263.279914855957, - 3269.5584297180176, - 3281.0748405456543, - 3272.946834564209 - ], - "Mean": 3232.44624710083, - "StandardError": 13.326165817293246, - "StandardDeviation": 46.163192531279066, + 3178.284008026123, + 3148.385368347168, + 3245.8696365356445, + 3179.538887023926, + 3184.6111640930176, + 3295.9537506103516, + 3263.8532333374023, + 3247.5730590820312, + 3246.272880554199, + 3267.2929763793945, + 3249.737579345703, + 3254.721321105957 + ], + "Mean": 3230.1744887034097, + "StandardError": 13.100567243794922, + "StandardDeviation": 45.38169614845075, "ConfidenceInterval": { "N": 12, - "Mean": 3232.44624710083, - "StandardError": 13.326165817293246, + "Mean": 3230.1744887034097, + "StandardError": 13.100567243794922, "Level": 12, - "Margin": 59.12792237472261, - "Lower": 3173.3183247261077, - "Upper": 3291.5741694755525 + "Margin": 58.126946165620744, + "Lower": 3172.047542537789, + "Upper": 3288.3014348690303 } }, "allocated_bytes": 3280 @@ -628,30 +638,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3139.3219604492188, - 3116.579692840576, - 3114.0731201171875, - 3124.893985748291, - 3104.449432373047, - 3108.8061332702637, - 3148.4101600646973, - 3098.632335662842, - 3111.3204956054688, - 3100.3915481567383, - 3133.8798179626465, - 3111.217342376709 - ], - "Mean": 3117.6646687189736, - "StandardError": 4.555314140989577, - "StandardDeviation": 15.780071073261846, + 3178.3809661865234, + 3176.1415824890137, + 3195.2853202819824, + 3161.6220474243164, + 3188.410919189453, + 3181.649845123291, + 3182.8037872314453, + 3181.096710205078, + 3191.7174644470215, + 3195.1719932556152, + 3189.3604621887207, + 3199.2411613464355 + ], + "Mean": 3185.0735216140747, + "StandardError": 2.9998355962155667, + "StandardDeviation": 10.391735333998072, "ConfidenceInterval": { "N": 12, - "Mean": 3117.6646687189736, - "StandardError": 4.555314140989577, + "Mean": 3185.0735216140747, + "StandardError": 2.9998355962155667, "Level": 12, - "Margin": 20.211834717783542, - "Lower": 3097.4528340011902, - "Upper": 3137.876503436757 + "Margin": 13.310208555246028, + "Lower": 3171.7633130588288, + "Upper": 3198.3837301693206 } }, "allocated_bytes": 1048 @@ -664,30 +674,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3013.4902000427246, - 3001.4405250549316, - 2997.9023933410645, - 3012.912910461426, - 3016.479648590088, - 3009.8837242126465, - 2998.359519958496, - 2984.0456619262695, - 3001.776695251465, - 2987.295150756836, - 3006.082057952881, - 3020.9190063476562 - ], - "Mean": 3004.2156244913735, - "StandardError": 3.265535059417119, - "StandardDeviation": 11.312145273615805, + 3202.8137817382812, + 3219.876926422119, + 3205.4805755615234, + 3198.812484741211, + 3200.655937194824, + 3184.2241287231445, + 3212.5585899353027, + 3198.4690017700195, + 3194.546699523926, + 3202.615104675293, + 3217.161178588867, + 3214.953742980957 + ], + "Mean": 3204.3473459879556, + "StandardError": 2.979388423749882, + "StandardDeviation": 10.320904250834694, "ConfidenceInterval": { "N": 12, - "Mean": 3004.2156244913735, - "StandardError": 3.265535059417119, + "Mean": 3204.3473459879556, + "StandardError": 2.979388423749882, "Level": 12, - "Margin": 14.489111583362321, - "Lower": 2989.726512908011, - "Upper": 3018.704736074736 + "Margin": 13.219484873512707, + "Lower": 3191.127861114443, + "Upper": 3217.566830861468 } }, "allocated_bytes": 1048 @@ -698,31 +708,32 @@ "method": "PolyTypeFastPath", "job": "JsonDeserializeBenchmark\u003CInt32[], JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 3128.6020278930664, - 3148.0394973754883, - 3107.9400367736816, - 3090.91854095459, - 3111.081600189209, - 3115.1108741760254, - 3113.24564743042, - 3125.7475242614746, - 3124.6765480041504, - 3126.4239959716797, - 3118.1624755859375 - ], - "Mean": 3119.0862516923385, - "StandardError": 4.359742503067217, - "StandardDeviation": 14.459630065238835, + 3052.7238845825195, + 3062.485855102539, + 3057.75101852417, + 3062.357582092285, + 3048.170886993408, + 3058.071933746338, + 3067.744731903076, + 3073.3353309631348, + 3072.075843811035, + 3063.906826019287, + 3054.6439476013184, + 3058.4449768066406 + ], + "Mean": 3060.9760681788125, + "StandardError": 2.1880475919883935, + "StandardDeviation": 7.579619197405268, "ConfidenceInterval": { - "N": 11, - "Mean": 3119.0862516923385, - "StandardError": 4.359742503067217, + "N": 12, + "Mean": 3060.9760681788125, + "StandardError": 2.1880475919883935, "Level": 12, - "Margin": 19.997676106894094, - "Lower": 3099.0885755854442, - "Upper": 3139.0839277992327 + "Margin": 9.708321954346392, + "Lower": 3051.267746224466, + "Upper": 3070.684390133159 } }, "allocated_bytes": 3280 @@ -733,31 +744,32 @@ "method": "StjReflection", "job": "JsonDeserializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Deserialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 1839.6834526062012, - 1842.1106338500977, - 1850.4869136810303, - 1821.281831741333, - 1798.9140357971191, - 1817.145824432373, - 1827.2790908813477, - 1858.6103115081787, - 1812.2865371704102, - 1832.9817447662354, - 1808.568796157837 - ], - "Mean": 1828.122652053833, - "StandardError": 5.58965143207523, - "StandardDeviation": 18.53877650906627, + 1809.9675178527832, + 1802.7892112731934, + 1833.1643733978271, + 1796.186050415039, + 1828.8909587860107, + 1778.8818683624268, + 1803.7149105072021, + 1786.7252826690674, + 1807.9962730407715, + 1798.1048412322998, + 1820.3356266021729, + 1799.0132961273193 + ], + "Mean": 1805.4808508555095, + "StandardError": 4.616998598425054, + "StandardDeviation": 15.993752301892979, "ConfidenceInterval": { - "N": 11, - "Mean": 1828.122652053833, - "StandardError": 5.58965143207523, + "N": 12, + "Mean": 1805.4808508555095, + "StandardError": 4.616998598425054, "Level": 12, - "Margin": 25.639137818446017, - "Lower": 1802.483514235387, - "Upper": 1853.761789872279 + "Margin": 20.485527380847866, + "Lower": 1784.9953234746617, + "Upper": 1825.9663782363573 } }, "allocated_bytes": 2640 @@ -768,31 +780,32 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 1799.1076316833496, - 1875.3823432922363, - 1918.1934986114502, - 1850.5544662475586, - 1859.104076385498, - 1828.664779663086, - 1852.2384967803955, - 2021.0776329040527, - 1924.3512153625488, - 1803.717851638794, - 1835.639476776123 - ], - "Mean": 1869.8210426677358, - "StandardError": 19.364999923573816, - "StandardDeviation": 64.22643881175534, + 1813.8093948364258, + 1810.590425491333, + 1767.2992553710938, + 1799.5095252990723, + 1787.146728515625, + 1809.2432022094727, + 1797.4408473968506, + 1814.6769218444824, + 1767.0647315979004, + 1798.425832748413, + 1816.0560131072998, + 1815.9987125396729 + ], + "Mean": 1799.7717992464702, + "StandardError": 5.108949214769734, + "StandardDeviation": 17.6979192265406, "ConfidenceInterval": { - "N": 11, - "Mean": 1869.8210426677358, - "StandardError": 19.364999923573816, + "N": 12, + "Mean": 1799.7717992464702, + "StandardError": 5.108949214769734, "Level": 12, - "Margin": 88.82519919679015, - "Lower": 1780.9958434709456, - "Upper": 1958.646241864526 + "Margin": 22.668302100465862, + "Lower": 1777.1034971460044, + "Upper": 1822.440101346936 } }, "allocated_bytes": 2616 @@ -805,30 +818,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1474.6547546386719, - 1461.9015045166016, - 1463.0255699157715, - 1435.2752380371094, - 1453.6971263885498, - 1485.8146514892578, - 1452.815055847168, - 1449.613332748413, - 1435.5717506408691, - 1434.0248107910156, - 1453.863302230835, - 1437.7331733703613 - ], - "Mean": 1453.165855884552, - "StandardError": 4.726559664105228, - "StandardDeviation": 16.37328296647188, + 1437.5191535949707, + 1420.1226234436035, + 1419.7057876586914, + 1410.4973487854004, + 1428.330421447754, + 1436.0980205535889, + 1418.946662902832, + 1434.97292137146, + 1423.011302947998, + 1427.6175498962402, + 1433.1199321746826, + 1411.5828685760498 + ], + "Mean": 1425.127049446106, + "StandardError": 2.6767785112117726, + "StandardDeviation": 9.272632764054736, "ConfidenceInterval": { "N": 12, - "Mean": 1453.165855884552, - "StandardError": 4.726559664105228, + "Mean": 1425.127049446106, + "StandardError": 2.6767785112117726, "Level": 12, - "Margin": 20.971647565426583, - "Lower": 1432.1942083191254, - "Upper": 1474.1375034499786 + "Margin": 11.876810944365305, + "Lower": 1413.2502385017406, + "Upper": 1437.0038603904713 } }, "allocated_bytes": 1760 @@ -841,30 +854,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1433.3354625701904, - 1440.3034057617188, - 1431.2304649353027, - 1427.7276992797852, - 1445.7491245269775, - 1451.9125633239746, - 1448.6727714538574, - 1427.4327754974365, - 1439.0874710083008, - 1440.054973602295, - 1444.6568489074707, - 1452.2197246551514 - ], - "Mean": 1440.1986071268718, - "StandardError": 2.5398434465492166, - "StandardDeviation": 8.798275785388181, + 1398.909646987915, + 1410.1026859283447, + 1396.658182144165, + 1391.566354751587, + 1398.9332523345947, + 1398.252248764038, + 1421.7338562011719, + 1436.340570449829, + 1429.929256439209, + 1406.7801628112793, + 1416.8511238098145, + 1434.4096183776855 + ], + "Mean": 1411.7055799166362, + "StandardError": 4.5628634329788325, + "StandardDeviation": 15.806222587834974, "ConfidenceInterval": { "N": 12, - "Mean": 1440.1986071268718, - "StandardError": 2.5398434465492166, + "Mean": 1411.7055799166362, + "StandardError": 4.5628634329788325, "Level": 12, - "Margin": 11.269232891926677, - "Lower": 1428.929374234945, - "Upper": 1451.4678400187986 + "Margin": 20.245330770349955, + "Lower": 1391.4602491462863, + "Upper": 1431.9509106869862 } }, "allocated_bytes": 1760 @@ -875,32 +888,34 @@ "method": "PolyTypeFastPath", "job": "JsonDeserializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 9, + "N": 11, "OriginalValues": [ - 1465.348403930664, - 1462.7296924591064, - 1465.8772945404053, - 1460.9358310699463, - 1477.3690700531006, - 1466.6028022766113, - 1458.6125202178955, - 1462.4957237243652, - 1453.891674041748 - ], - "Mean": 1463.7625569237603, - "StandardError": 2.156419616427219, - "StandardDeviation": 6.469258849281657, + 1346.5123977661133, + 1318.9550228118896, + 1312.2856616973877, + 1341.4494190216064, + 1319.6467571258545, + 1323.4648704528809, + 1336.8921279907227, + 1318.1825485229492, + 1329.4538650512695, + 1327.588716506958, + 1304.4326305389404 + ], + "Mean": 1325.351274316961, + "StandardError": 3.8122704995035233, + "StandardDeviation": 12.643870846193948, "ConfidenceInterval": { - "N": 9, - "Mean": 1463.7625569237603, - "StandardError": 2.156419616427219, + "N": 11, + "Mean": 1325.351274316961, + "StandardError": 3.8122704995035233, "Level": 12, - "Margin": 10.871169923012491, - "Lower": 1452.8913870007477, - "Upper": 1474.6337268467728 + "Margin": 17.4864801366833, + "Lower": 1307.8647941802778, + "Upper": 1342.8377544536443 } }, - "allocated_bytes": 3136 + "allocated_bytes": 2064 }, { "operation": "Deserialize", @@ -908,30 +923,31 @@ "method": "StjReflection", "job": "JsonDeserializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.Deserialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 8048507.8125, - 7953294.265625, - 7892047.53125, - 7769273.4375, - 7782613.921875, - 7778839.84375, - 7787503.25, - 7788807.296875, - 7815900.390625, - 7773014.328125 - ], - "Mean": 7838980.2078125, - "StandardError": 30090.620647516127, - "StandardDeviation": 95154.89745424163, + 7171179.359375, + 7184021.8125, + 7176294.59375, + 7185321.9375, + 7198446.9375, + 7187875.9765625, + 7155017.2578125, + 7155981.4453125, + 7197102.8671875, + 7189361.9765625, + 7192778.3203125 + ], + "Mean": 7181216.589488637, + "StandardError": 4539.262824466231, + "StandardDeviation": 15055.031613563375, "ConfidenceInterval": { - "N": 10, - "Mean": 7838980.2078125, - "StandardError": 30090.620647516127, + "N": 11, + "Mean": 7181216.589488637, + "StandardError": 4539.262824466231, "Level": 12, - "Margin": 143860.62693265735, - "Lower": 7695119.580879843, - "Upper": 7982840.8347451575 + "Margin": 20821.116766386564, + "Lower": 7160395.47272225, + "Upper": 7202037.706255023 } }, "allocated_bytes": 9011160 @@ -942,30 +958,31 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 7187417.3203125, - 7165857.75, - 7174314.125, - 7131996.09375, - 7137849.609375, - 7159208.3359375, - 7171788.7421875, - 7167937.5, - 7147278, - 7154249.671875 - ], - "Mean": 7159789.71484375, - "StandardError": 5439.417730758605, - "StandardDeviation": 17200.949174301717, + 7166554.359375, + 7117596.3515625, + 7149000, + 7134086.9140625, + 7126083.984375, + 7142495.765625, + 7140186.5234375, + 7149176.4296875, + 7134990.8828125, + 7145135.7421875, + 7119813.4765625 + ], + "Mean": 7138647.3117897725, + "StandardError": 4312.754289880293, + "StandardDeviation": 14303.78779252858, "ConfidenceInterval": { - "N": 10, - "Mean": 7159789.71484375, - "StandardError": 5439.417730758605, + "N": 11, + "Mean": 7138647.3117897725, + "StandardError": 4312.754289880293, "Level": 12, - "Margin": 26005.38068197471, - "Lower": 7133784.334161775, - "Upper": 7185795.095525725 + "Margin": 19782.14616045971, + "Lower": 7118865.165629312, + "Upper": 7158429.457950233 } }, "allocated_bytes": 8912856 @@ -976,32 +993,31 @@ "method": "PolyTypeReflection", "job": "JsonDeserializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.Deserialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 5865574.875, - 5892895.5078125, - 5927463.8671875, - 5909750.9765625, - 5933632.1640625, - 5896135.7421875, - 5901472.984375, - 5900594.7265625, - 5873224.28125, - 5893999.0234375, - 5897472.3359375, - 5930160.4765625 - ], - "Mean": 5901864.746744792, - "StandardError": 6068.269321225724, - "StandardDeviation": 21021.101556748912, + 5885150.7109375, + 5871247.3984375, + 5884549.15625, + 5885402.0234375, + 5882951.171875, + 5879944.984375, + 5893170.8984375, + 5879936.5234375, + 5898467.1171875, + 5903952.4765625, + 5885068.6875 + ], + "Mean": 5886349.1953125, + "StandardError": 2750.562959810755, + "StandardDeviation": 9122.585299941673, "ConfidenceInterval": { - "N": 12, - "Mean": 5901864.746744792, - "StandardError": 6068.269321225724, + "N": 11, + "Mean": 5886349.1953125, + "StandardError": 2750.562959810755, "Level": 12, - "Margin": 26924.78559052059, - "Lower": 5874939.961154272, - "Upper": 5928789.532335312 + "Margin": 12616.540344577177, + "Lower": 5873732.654967923, + "Upper": 5898965.735657077 } }, "allocated_bytes": 7273720 @@ -1014,30 +1030,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 5948635.09375, - 5950000.328125, - 5974329.1015625, - 5947743.484375, - 5962456.0546875, - 5925333.328125, - 5934139.3203125, - 5925627.6015625, - 5940230.46875, - 5952868.1640625, - 5958197.265625, - 5942174.1484375 - ], - "Mean": 5946811.196614583, - "StandardError": 4190.646690407785, - "StandardDeviation": 14516.825968713292, + 5933834.3125, + 5927392.8984375, + 5927510.4140625, + 5926259.4375, + 5935160.484375, + 5889192.3828125, + 5942544.921875, + 5933244.140625, + 5923196.6171875, + 5930189.7734375, + 5929403, + 5927196.6171875 + ], + "Mean": 5927093.75, + "StandardError": 3748.396057696348, + "StandardDeviation": 12984.82483764191, "ConfidenceInterval": { "N": 12, - "Mean": 5946811.196614583, - "StandardError": 4190.646690407785, + "Mean": 5927093.75, + "StandardError": 3748.396057696348, "Level": 12, - "Margin": 18593.812774622114, - "Lower": 5928217.383839961, - "Upper": 5965405.009389205 + "Margin": 16631.555855441355, + "Lower": 5910462.194144559, + "Upper": 5943725.305855441 } }, "allocated_bytes": 7273720 @@ -1050,33 +1066,33 @@ "statistics": { "N": 12, "OriginalValues": [ - 6113923.828125, - 6128737.3046875, - 6107184.890625, - 6147140.296875, - 6118257.1640625, - 6154571.2890625, - 6136270.1796875, - 6079649.4140625, - 6108206.703125, - 6105962.2421875, - 6140883.140625, - 6126355.140625 - ], - "Mean": 6122261.799479167, - "StandardError": 6065.568601983147, - "StandardDeviation": 21011.74599085867, + 5518910.8046875, + 5460612.3046875, + 5472122.71875, + 5471261.0625, + 5486223.3046875, + 5516853.84375, + 5500550.4609375, + 5467856.1171875, + 5472115.5625, + 5444535.484375, + 5546573.890625, + 5481880.53125 + ], + "Mean": 5486624.673828125, + "StandardError": 8359.337270907943, + "StandardDeviation": 28957.593741633435, "ConfidenceInterval": { "N": 12, - "Mean": 6122261.799479167, - "StandardError": 6065.568601983147, + "Mean": 5486624.673828125, + "StandardError": 8359.337270907943, "Level": 12, - "Margin": 26912.802555045844, - "Lower": 6095348.996924121, - "Upper": 6149174.602034213 + "Margin": 37090.206743259965, + "Lower": 5449534.467084865, + "Upper": 5523714.880571385 } }, - "allocated_bytes": 12975616 + "allocated_bytes": 8584704 }, { "operation": "Deserialize", @@ -1086,30 +1102,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3077.0316123962402, - 3067.69482421875, - 3095.21484375, - 3080.392837524414, - 3074.8446769714355, - 3092.8422622680664, - 3099.102020263672, - 3074.1570777893066, - 3088.4669647216797, - 3096.019744873047, - 3090.766273498535, - 3116.123992919922 - ], - "Mean": 3087.721427599589, - "StandardError": 3.9081638894394843, - "StandardDeviation": 13.538276841630365, + 3067.509967803955, + 3052.457332611084, + 3085.9740562438965, + 3060.8890838623047, + 3046.95463180542, + 3041.5611267089844, + 3075.5917205810547, + 3068.4420280456543, + 3039.804618835449, + 3067.7409172058105, + 3059.713840484619, + 3065.341152191162 + ], + "Mean": 3060.998373031616, + "StandardError": 3.986436105294065, + "StandardDeviation": 13.80941975099263, "ConfidenceInterval": { "N": 12, - "Mean": 3087.721427599589, - "StandardError": 3.9081638894394843, + "Mean": 3060.998373031616, + "StandardError": 3.986436105294065, "Level": 12, - "Margin": 17.340442423626403, - "Lower": 3070.3809851759625, - "Upper": 3105.0618700232153 + "Margin": 17.687734628045874, + "Lower": 3043.3106384035705, + "Upper": 3078.686107659662 } }, "allocated_bytes": 2232 @@ -1120,31 +1136,32 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CList\u003CInt32\u003E, JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 3025.445301055908, - 3011.159580230713, - 2995.9637336730957, - 2995.850086212158, - 3003.31974029541, - 2989.9260177612305, - 3002.4919509887695, - 3003.5506858825684, - 3008.6261444091797, - 2993.950050354004, - 3007.15287399292 - ], - "Mean": 3003.403287714178, - "StandardError": 2.9719990446106666, - "StandardDeviation": 9.8570057082683, + 3034.0023040771484, + 3033.163547515869, + 3053.344886779785, + 3008.815128326416, + 3038.7231521606445, + 3055.9517555236816, + 3037.3010635375977, + 3056.4764366149902, + 3015.566825866699, + 3031.235851287842, + 3038.6195182800293, + 3026.5606231689453 + ], + "Mean": 3035.813424428304, + "StandardError": 4.276540684374918, + "StandardDeviation": 14.81437149194547, "ConfidenceInterval": { - "N": 11, - "Mean": 3003.403287714178, - "StandardError": 2.9719990446106666, + "N": 12, + "Mean": 3035.813424428304, + "StandardError": 4.276540684374918, "Level": 12, - "Margin": 13.632244161738853, - "Lower": 2989.771043552439, - "Upper": 3017.035531875917 + "Margin": 18.9749226510393, + "Lower": 3016.838501777265, + "Upper": 3054.7883470793436 } }, "allocated_bytes": 2232 @@ -1157,30 +1174,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3157.26375579834, - 3134.704750061035, - 3149.045783996582, - 3168.993152618408, - 3152.2108726501465, - 3144.318103790283, - 3150.5206413269043, - 3151.578266143799, - 3165.0506629943848, - 3133.490882873535, - 3181.3693046569824, - 3122.3184242248535 - ], - "Mean": 3150.905383427938, - "StandardError": 4.709621658942635, - "StandardDeviation": 16.314607995430933, + 3204.285144805908, + 3180.2616119384766, + 3171.621639251709, + 3171.855609893799, + 3185.582160949707, + 3171.116828918457, + 3172.720115661621, + 3201.2147903442383, + 3212.929885864258, + 3178.7797622680664, + 3156.5194129943848, + 3211.790084838867 + ], + "Mean": 3184.8897539774575, + "StandardError": 5.2946496068062645, + "StandardDeviation": 18.34120425452606, "ConfidenceInterval": { "N": 12, - "Mean": 3150.905383427938, - "StandardError": 4.709621658942635, + "Mean": 3184.8897539774575, + "StandardError": 5.2946496068062645, "Level": 12, - "Margin": 20.896493986507675, - "Lower": 3130.0088894414303, - "Upper": 3171.8018774144457 + "Margin": 23.492250902832016, + "Lower": 3161.3975030746255, + "Upper": 3208.3820048802895 } }, "allocated_bytes": 2232 @@ -1193,30 +1210,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3064.102493286133, - 3080.220859527588, - 3064.252696990967, - 3098.5331535339355, - 3075.430549621582, - 3068.778835296631, - 3079.8753089904785, - 3083.639621734619, - 3067.2613792419434, - 3064.523220062256, - 3072.946071624756, - 3060.2606163024902 - ], - "Mean": 3073.3187338511148, - "StandardError": 3.1500651520579788, - "StandardDeviation": 10.9121457810332, + 3103.713035583496, + 3108.842056274414, + 3128.972053527832, + 3082.9834938049316, + 3107.327304840088, + 3102.0806617736816, + 3108.461696624756, + 3134.950954437256, + 3116.5690422058105, + 3114.394821166992, + 3130.340419769287, + 3112.121742248535 + ], + "Mean": 3112.563106854757, + "StandardError": 4.107771582554913, + "StandardDeviation": 14.229738173745444, "ConfidenceInterval": { "N": 12, - "Mean": 3073.3187338511148, - "StandardError": 3.1500651520579788, + "Mean": 3112.563106854757, + "StandardError": 4.107771582554913, "Level": 12, - "Margin": 13.976773990347557, - "Lower": 3059.341959860767, - "Upper": 3087.2955078414625 + "Margin": 18.226097633515106, + "Lower": 3094.3370092212417, + "Upper": 3130.789204488272 } }, "allocated_bytes": 2232 @@ -1229,30 +1246,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 2889.299072265625, - 2895.803134918213, - 2921.9183921813965, - 2900.1900367736816, - 2915.659107208252, - 2892.1750411987305, - 2912.2611694335938, - 2896.352928161621, - 2892.3424072265625, - 2932.8492469787598, - 2897.0699310302734, - 2902.040958404541 - ], - "Mean": 2903.996785481771, - "StandardError": 3.9325965164164156, - "StandardDeviation": 13.622913944203212, + 2999.0216903686523, + 2980.1410064697266, + 2997.1303939819336, + 2973.10050201416, + 2968.658130645752, + 2997.6751022338867, + 2965.3312339782715, + 2985.4445457458496, + 2974.4512252807617, + 2991.8676986694336, + 3004.443645477295, + 2982.7887229919434 + ], + "Mean": 2985.0044914881387, + "StandardError": 3.7589507363182024, + "StandardDeviation": 13.021387316903136, "ConfidenceInterval": { "N": 12, - "Mean": 2903.996785481771, - "StandardError": 3.9325965164164156, + "Mean": 2985.0044914881387, + "StandardError": 3.7589507363182024, "Level": 12, - "Margin": 17.448849484675264, - "Lower": 2886.547935997096, - "Upper": 2921.445634966446 + "Margin": 16.678386746396747, + "Lower": 2968.326104741742, + "Upper": 3001.6828782345356 } }, "allocated_bytes": 2232 @@ -1265,30 +1282,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 565.1144189834595, - 582.6777219772339, - 571.5611381530762, - 568.9040813446045, - 562.3881416320801, - 566.5567321777344, - 574.9992532730103, - 573.1866750717163, - 578.710000038147, - 572.6217823028564, - 567.5311880111694, - 568.5805883407593 - ], - "Mean": 571.0693101088206, - "StandardError": 1.674908759929611, - "StandardDeviation": 5.802054140480539, + 561.4879131317139, + 553.3128976821899, + 576.3844652175903, + 560.0357456207275, + 549.3301944732666, + 573.8637046813965, + 563.7331800460815, + 560.105523109436, + 570.8924922943115, + 571.3322954177856, + 556.7406415939331, + 559.9773330688477 + ], + "Mean": 563.0996988614401, + "StandardError": 2.4273874055805864, + "StandardDeviation": 8.408716632236752, "ConfidenceInterval": { "N": 12, - "Mean": 571.0693101088206, - "StandardError": 1.674908759929611, + "Mean": 563.0996988614401, + "StandardError": 2.4273874055805864, "Level": 12, - "Margin": 7.4315355594139145, - "Lower": 563.6377745494067, - "Upper": 578.5008456682344 + "Margin": 10.770267761811528, + "Lower": 552.3294310996286, + "Upper": 573.8699666232516 } }, "allocated_bytes": 1016 @@ -1299,31 +1316,32 @@ "method": "StjSourceGen", "job": "JsonDeserializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Deserialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 577.2460699081421, - 562.520583152771, - 561.9343118667603, - 580.0070762634277, - 557.2331352233887, - 561.3544788360596, - 561.9864463806152, - 557.8304128646851, - 582.0428533554077, - 560.4623556137085, - 579.8059301376343 - ], - "Mean": 567.4930594184182, - "StandardError": 2.99502443810976, - "StandardDeviation": 9.933372299155081, + 572.7922916412354, + 577.8388175964355, + 571.7126131057739, + 573.8437566757202, + 560.1777229309082, + 569.1006183624268, + 571.0285501480103, + 583.1379098892212, + 586.366455078125, + 579.450686454773, + 561.4861650466919, + 559.6779584884644 + ], + "Mean": 572.2177954514822, + "StandardError": 2.515230758830064, + "StandardDeviation": 8.713014934107385, "ConfidenceInterval": { - "N": 11, - "Mean": 567.4930594184182, - "StandardError": 2.99502443810976, + "N": 12, + "Mean": 572.2177954514822, + "StandardError": 2.515230758830064, "Level": 12, - "Margin": 13.737859197742633, - "Lower": 553.7552002206755, - "Upper": 581.2309186161608 + "Margin": 11.16002690508515, + "Lower": 561.057768546397, + "Upper": 583.3778223565673 } }, "allocated_bytes": 992 @@ -1334,32 +1352,31 @@ "method": "PolyTypeReflection", "job": "JsonDeserializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Deserialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 277.1297492980957, - 280.15029430389404, - 277.521550655365, - 289.2677984237671, - 287.03635931015015, - 291.13258934020996, - 291.29719734191895, - 286.27079725265503, - 277.6382369995117, - 280.318359375, - 278.0919671058655, - 279.2591052055359 - ], - "Mean": 282.92616705099744, - "StandardError": 1.6232438959373077, - "StandardDeviation": 5.623081801678929, + 283.5700116157532, + 281.96384477615356, + 280.71542596817017, + 284.1058769226074, + 278.94858503341675, + 279.17553997039795, + 281.152268409729, + 282.545606136322, + 279.41954135894775, + 286.6716184616089, + 280.82420444488525 + ], + "Mean": 281.73568391799927, + "StandardError": 0.7132060936725618, + "StandardDeviation": 2.365437010906954, "ConfidenceInterval": { - "N": 12, - "Mean": 282.92616705099744, - "StandardError": 1.6232438959373077, + "N": 11, + "Mean": 281.73568391799927, + "StandardError": 0.7132060936725618, "Level": 12, - "Margin": 7.202299625423563, - "Lower": 275.72386742557387, - "Upper": 290.128466676421 + "Margin": 3.271400650082652, + "Lower": 278.46428326791664, + "Upper": 285.0070845680819 } }, "allocated_bytes": 440 @@ -1370,30 +1387,31 @@ "method": "PolyTypeSourceGen", "job": "JsonDeserializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Deserialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 271.63517475128174, - 270.57991456985474, - 268.95771408081055, - 271.0351548194885, - 270.75781440734863, - 271.11760807037354, - 272.284884929657, - 271.60362434387207, - 270.16397285461426, - 274.3311128616333 - ], - "Mean": 271.2466975688934, - "StandardError": 0.4475429327710701, - "StandardDeviation": 1.415255018268194, + 272.45418214797974, + 272.171875, + 273.220419883728, + 273.8429112434387, + 272.6537780761719, + 271.5478138923645, + 271.0971632003784, + 272.0725932121277, + 271.75078773498535, + 269.432981967926, + 271.7602849006653 + ], + "Mean": 272.0004355690696, + "StandardError": 0.34749755610560823, + "StandardDeviation": 1.1525190091677766, "ConfidenceInterval": { - "N": 10, - "Mean": 271.2466975688934, - "StandardError": 0.4475429327710701, + "N": 11, + "Mean": 272.0004355690696, + "StandardError": 0.34749755610560823, "Level": 12, - "Margin": 2.139663639441778, - "Lower": 269.10703392945163, - "Upper": 273.3863612083352 + "Margin": 1.593934405540756, + "Lower": 270.40650116352884, + "Upper": 273.5943699746104 } }, "allocated_bytes": 440 @@ -1406,33 +1424,33 @@ "statistics": { "N": 12, "OriginalValues": [ - 241.3158416748047, - 239.14082860946655, - 247.8915057182312, - 254.64463233947754, - 252.20068311691284, - 246.4610733985901, - 252.15518474578857, - 251.9389190673828, - 245.45572185516357, - 253.1432704925537, - 252.03631353378296, - 251.98237085342407 - ], - "Mean": 249.03052878379822, - "StandardError": 1.4366793834448128, - "StandardDeviation": 4.976803372626289, + 233.9796028137207, + 241.13242840766907, + 241.610586643219, + 236.569176197052, + 234.4106137752533, + 230.69574427604675, + 228.6192774772644, + 231.00313544273376, + 231.8379282951355, + 230.04599404335022, + 228.8624246120453, + 237.36564302444458 + ], + "Mean": 233.84437958399454, + "StandardError": 1.2972992530367704, + "StandardDeviation": 4.493976437761678, "ConfidenceInterval": { "N": 12, - "Mean": 249.03052878379822, - "StandardError": 1.4366793834448128, + "Mean": 233.84437958399454, + "StandardError": 1.2972992530367704, "Level": 12, - "Margin": 6.374516738449491, - "Lower": 242.65601204534872, - "Upper": 255.40504552224772 + "Margin": 5.756089979820175, + "Lower": 228.08828960417435, + "Upper": 239.60046956381473 } }, - "allocated_bytes": 576 + "allocated_bytes": 440 }, { "operation": "Deserialize", @@ -1440,31 +1458,32 @@ "method": "StjReflection", "job": "JsonDeserializeBenchmark\u003CString, JsonBenchmarkWitness\u003E.Deserialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 33.276634871959686, - 33.47456705570221, - 33.38010609149933, - 33.25454145669937, - 33.16421312093735, - 33.30334770679474, - 33.70657807588577, - 33.35561102628708, - 33.948500990867615, - 32.92607760429382, - 33.13936787843704 - ], - "Mean": 33.35723144357855, - "StandardError": 0.08401812602436366, - "StandardDeviation": 0.2786565996116087, + 34.50743609666824, + 34.066349267959595, + 34.30785983800888, + 34.06759601831436, + 34.50785577297211, + 33.71829044818878, + 34.333628952503204, + 34.68281525373459, + 34.48174148797989, + 34.238959312438965, + 34.42829352617264, + 34.25175452232361 + ], + "Mean": 34.29938170810541, + "StandardError": 0.07469647866290116, + "StandardDeviation": 0.25875619238125874, "ConfidenceInterval": { - "N": 11, - "Mean": 33.35723144357855, - "StandardError": 0.08401812602436366, + "N": 12, + "Mean": 34.29938170810541, + "StandardError": 0.07469647866290116, "Level": 12, - "Margin": 0.3853822261661975, - "Lower": 32.97184921741235, - "Upper": 33.74261366974475 + "Margin": 0.331426732384922, + "Lower": 33.96795497572049, + "Upper": 34.63080844049033 } }, "allocated_bytes": 56 @@ -1477,30 +1496,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 32.61483955383301, - 33.371073484420776, - 32.46935951709747, - 32.509490847587585, - 32.64668583869934, - 32.88554894924164, - 32.2878857254982, - 32.413701236248016, - 32.89680677652359, - 32.449476420879364, - 32.95281529426575, - 32.8293120265007 - ], - "Mean": 32.69391630589962, - "StandardError": 0.08781198365580402, - "StandardDeviation": 0.30418963441052077, + 33.37795037031174, + 33.232611894607544, + 33.416926860809326, + 33.41527283191681, + 33.40880072116852, + 34.3729208111763, + 33.97321701049805, + 33.649250864982605, + 34.01021659374237, + 33.961822628974915, + 33.323352575302124, + 34.21616554260254 + ], + "Mean": 33.6965423921744, + "StandardError": 0.11251741038386907, + "StandardDeviation": 0.3897717430418784, "ConfidenceInterval": { "N": 12, - "Mean": 32.69391630589962, - "StandardError": 0.08781198365580402, + "Mean": 33.6965423921744, + "StandardError": 0.11251741038386907, "Level": 12, - "Margin": 0.3896199570346781, - "Lower": 32.304296348864945, - "Upper": 33.083536262934295 + "Margin": 0.4992374249424979, + "Lower": 33.1973049672319, + "Upper": 34.1957798171169 } }, "allocated_bytes": 56 @@ -1511,32 +1530,31 @@ "method": "PolyTypeReflection", "job": "JsonDeserializeBenchmark\u003CString, JsonBenchmarkWitness\u003E.Deserialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 27.160758793354034, - 27.79513970017433, - 27.755940973758698, - 27.68864607810974, - 27.240944415330887, - 27.765506237745285, - 28.073716908693314, - 27.604497969150543, - 27.904022485017776, - 28.078200936317444, - 27.56017941236496, - 27.806981146335602 - ], - "Mean": 27.702877921362717, - "StandardError": 0.08176349412150563, - "StandardDeviation": 0.28323705204561395, + 26.96315696835518, + 27.367568284273148, + 27.332928031682968, + 27.16624364256859, + 27.348919481039047, + 27.230487495660782, + 27.373122662305832, + 27.567334473133087, + 26.988599449396133, + 27.41323286294937, + 27.40301936864853 + ], + "Mean": 27.286782974546608, + "StandardError": 0.05555724768106352, + "StandardDeviation": 0.18426254494293032, "ConfidenceInterval": { - "N": 12, - "Mean": 27.702877921362717, - "StandardError": 0.08176349412150563, + "N": 11, + "Mean": 27.286782974546608, + "StandardError": 0.05555724768106352, "Level": 12, - "Margin": 0.36278293395004724, - "Lower": 27.34009498741267, - "Upper": 28.065660855312764 + "Margin": 0.25483519811887206, + "Lower": 27.031947776427735, + "Upper": 27.54161817266548 } }, "allocated_bytes": 56 @@ -1549,30 +1567,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 25.520414113998413, - 25.816167414188385, - 25.804895907640457, - 25.642644613981247, - 25.68651857972145, - 25.62635514140129, - 25.781989097595215, - 25.638086080551147, - 25.87161710858345, - 25.803613156080246, - 26.10870823264122, - 25.893508166074753 - ], - "Mean": 25.766209801038105, - "StandardError": 0.04508163508937134, - "StandardDeviation": 0.1561673649261421, + 27.139775454998016, + 26.968487828969955, + 26.844456791877747, + 27.30286741256714, + 27.428214728832245, + 26.7961286008358, + 27.30758860707283, + 27.05020582675934, + 27.08691856265068, + 26.466138660907745, + 27.16272696852684, + 26.799981772899628 + ], + "Mean": 27.029457601408165, + "StandardError": 0.07819713101955074, + "StandardDeviation": 0.2708828078639643, "ConfidenceInterval": { "N": 12, - "Mean": 25.766209801038105, - "StandardError": 0.04508163508937134, + "Mean": 27.029457601408165, + "StandardError": 0.07819713101955074, "Level": 12, - "Margin": 0.20002628337633438, - "Lower": 25.56618351766177, - "Upper": 25.96623608441444 + "Margin": 0.3469590545579105, + "Lower": 26.682498546850255, + "Upper": 27.376416655966075 } }, "allocated_bytes": 56 @@ -1583,32 +1601,31 @@ "method": "PolyTypeFastPath", "job": "JsonDeserializeBenchmark\u003CString, JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 26.67314186692238, - 26.629728585481644, - 26.630143344402313, - 26.703110575675964, - 26.916109025478363, - 26.74030637741089, - 26.700877875089645, - 26.89408388733864, - 26.75924202799797, - 26.85280391573906, - 26.80661404132843, - 26.831698924303055 - ], - "Mean": 26.761488370597363, - "StandardError": 0.028437341855483467, - "StandardDeviation": 0.09850984185180474, + 29.554170846939087, + 29.952610552310944, + 29.865674674510956, + 29.708705842494965, + 29.50226765871048, + 30.110140681266785, + 29.280332267284393, + 29.840414702892303, + 30.781373381614685, + 29.941042304039, + 30.420842230319977 + ], + "Mean": 29.90523410385305, + "StandardError": 0.12790283126327648, + "StandardDeviation": 0.4242057009244264, "ConfidenceInterval": { - "N": 12, - "Mean": 26.761488370597363, - "StandardError": 0.028437341855483467, + "N": 11, + "Mean": 29.90523410385305, + "StandardError": 0.12790283126327648, "Level": 12, - "Margin": 0.12617589821616101, - "Lower": 26.6353124723812, - "Upper": 26.887664268813523 + "Margin": 0.5866767110576522, + "Lower": 29.318557392795398, + "Upper": 30.491910814910703 } }, "allocated_bytes": 56 @@ -1621,30 +1638,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3171187.98828125, - 3105449.37890625, - 3097071.44921875, - 3099096.515625, - 3123882.6484375, - 3134083.171875, - 3143497.55859375, - 3165314.2890625, - 3143178.22265625, - 3097769.53125, - 3099052.08203125, - 3101545.8984375 - ], - "Mean": 3123427.39453125, - "StandardError": 7921.663832383137, - "StandardDeviation": 27441.448476336758, + 3122039.7109375, + 3118859.5390625, + 3142656.90234375, + 3056394.04296875, + 3093281.4140625, + 3102758.140625, + 3083268.06640625, + 3094762.04296875, + 3098410.3203125, + 3146334.9609375, + 3073327.1484375, + 3080407.71484375 + ], + "Mean": 3101041.6669921875, + "StandardError": 7859.753592995435, + "StandardDeviation": 27226.985116080254, "ConfidenceInterval": { "N": 12, - "Mean": 3123427.39453125, - "StandardError": 7921.663832383137, + "Mean": 3101041.6669921875, + "StandardError": 7859.753592995435, "Level": 12, - "Margin": 35148.25874010739, - "Lower": 3088279.1357911425, - "Upper": 3158575.6532713575 + "Margin": 34873.564287186346, + "Lower": 3066168.1027050014, + "Upper": 3135915.2312793736 } }, "allocated_bytes": 912 @@ -1657,30 +1674,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 3029253.74609375, - 3026100.09765625, - 3055259.60546875, - 3011579.58984375, - 3011747.8828125, - 3019485.83984375, - 3040655.92578125, - 3058409.34375, - 3035173.50390625, - 3064497.71875, - 3024409.1796875, - 3017045.25 - ], - "Mean": 3032801.4736328125, - "StandardError": 5279.472634139277, - "StandardDeviation": 18288.629678997444, + 3078564.77734375, + 3085452.63671875, + 3102558.91796875, + 3015849.9375, + 3058232.421875, + 3054834.47265625, + 3048782.0625, + 3046677.5703125, + 3065411.296875, + 3087418.45703125, + 3034077.1484375, + 3031663.57421875 + ], + "Mean": 3059126.939453125, + "StandardError": 7453.374166398863, + "StandardDeviation": 25819.245488048316, "ConfidenceInterval": { "N": 12, - "Mean": 3032801.4736328125, - "StandardError": 5279.472634139277, + "Mean": 3059126.939453125, + "StandardError": 7453.374166398863, "Level": 12, - "Margin": 23424.910988708147, - "Lower": 3009376.5626441045, - "Upper": 3056226.3846215205 + "Margin": 33070.467168335774, + "Lower": 3026056.472284789, + "Upper": 3092197.406621461 } }, "allocated_bytes": 912 @@ -1693,30 +1710,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1503942.626953125, - 1504976.806640625, - 1508086.9140625, - 1506492.1875, - 1507254.80078125, - 1505759.765625, - 1503667.642578125, - 1506247.96484375, - 1504933.10546875, - 1506399.4140625, - 1507382.40625, - 1506917.3984375 - ], - "Mean": 1506005.0861002605, - "StandardError": 399.44027745151806, - "StandardDeviation": 1383.7017102708764, + 1592917.96875, + 1590561.359375, + 1590003.009765625, + 1592112.630859375, + 1587534.09765625, + 1588459.310546875, + 1589215.65625, + 1587453.369140625, + 1589125.162109375, + 1590467.123046875, + 1589367.1875, + 1585327.392578125 + ], + "Mean": 1589378.6889648438, + "StandardError": 599.4488290299283, + "StandardDeviation": 2076.5516568350104, "ConfidenceInterval": { "N": 12, - "Mean": 1506005.0861002605, - "StandardError": 399.44027745151806, + "Mean": 1589378.6889648438, + "StandardError": 599.4488290299283, "Level": 12, - "Margin": 1772.3082574765847, - "Lower": 1504232.7778427838, - "Upper": 1507777.3943577372 + "Margin": 2659.7420680826585, + "Lower": 1586718.9468967612, + "Upper": 1592038.4310329263 } }, "allocated_bytes": 0 @@ -1727,31 +1744,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CCitmCatalog[], JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 1716702.71875, - 1720801.26953125, - 1713210.205078125, - 1715163.736328125, - 1712060.302734375, - 1710155.76171875, - 1709145.83203125, - 1711876.953125, - 1708614.666015625, - 1710873.861328125, - 1710458.822265625 - ], - "Mean": 1712642.1935369319, - "StandardError": 1100.3526907676562, - "StandardDeviation": 3649.457012334278, + 1789341.876953125, + 1788200.68359375, + 1785251.626953125, + 1785577.63671875, + 1785134.1953125, + 1786114.095703125, + 1785341.958984375, + 1786231.12109375, + 1789024.005859375, + 1786002.44140625, + 1786461.587890625, + 1786855.46875 + ], + "Mean": 1786628.0582682292, + "StandardError": 420.6298905281906, + "StandardDeviation": 1457.1046831539218, "ConfidenceInterval": { - "N": 11, - "Mean": 1712642.1935369319, - "StandardError": 1100.3526907676562, + "N": 12, + "Mean": 1786628.0582682292, + "StandardError": 420.6298905281906, "Level": 12, - "Margin": 5047.200998187422, - "Lower": 1707594.9925387444, - "Upper": 1717689.3945351194 + "Margin": 1866.3261328599172, + "Lower": 1784761.7321353694, + "Upper": 1788494.384401089 } }, "allocated_bytes": 0 @@ -1762,32 +1780,31 @@ "method": "PolyTypeSourceGen", "job": "JsonSerializeBenchmark\u003CCitmCatalog[], JsonBenchmarkWitness\u003E.Serialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 1722177.978515625, - 1722594.646484375, - 1718948.89453125, - 1720567.544921875, - 1723910.15625, - 1724470.1328125, - 1722612.3046875, - 1725254.4765625, - 1722280.435546875, - 1719690.755859375, - 1718751.62890625, - 1723142.08984375 - ], - "Mean": 1722033.4204101562, - "StandardError": 613.7155479917208, - "StandardDeviation": 2125.973021033272, + 1802504.638671875, + 1799610.1875, + 1800946.859375, + 1799775.146484375, + 1799400.47265625, + 1799277.181640625, + 1802959.30859375, + 1802289.876953125, + 1800819.662109375, + 1801096.599609375, + 1801625.5703125 + ], + "Mean": 1800936.8639914773, + "StandardError": 394.475643507651, + "StandardDeviation": 1308.3276984488743, "ConfidenceInterval": { - "N": 12, - "Mean": 1722033.4204101562, - "StandardError": 613.7155479917208, + "N": 11, + "Mean": 1800936.8639914773, + "StandardError": 394.475643507651, "Level": 12, - "Margin": 2723.0432053250124, - "Lower": 1719310.3772048312, - "Upper": 1724756.4636154813 + "Margin": 1809.41790607467, + "Lower": 1799127.4460854025, + "Upper": 1802746.281897552 } }, "allocated_bytes": 0 @@ -1800,30 +1817,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1587198.080078125, - 1590405.2734375, - 1590109.86328125, - 1589045.654296875, - 1589053.546875, - 1583991.53515625, - 1588177.734375, - 1586149.90234375, - 1585526.529296875, - 1586138.103515625, - 1588421.712890625, - 1587150.228515625 - ], - "Mean": 1587614.013671875, - "StandardError": 559.3717928029432, - "StandardDeviation": 1937.720730911177, + 1589481.52734375, + 1589039.306640625, + 1582313.802734375, + 1585708.49609375, + 1585740.966796875, + 1586762.287109375, + 1587133.056640625, + 1587705.73046875, + 1587420.818359375, + 1583897.705078125, + 1584156.658203125, + 1589430.74609375 + ], + "Mean": 1586565.9251302083, + "StandardError": 660.7846425328736, + "StandardDeviation": 2289.025147456351, "ConfidenceInterval": { "N": 12, - "Mean": 1587614.013671875, - "StandardError": 559.3717928029432, + "Mean": 1586565.9251302083, + "StandardError": 660.7846425328736, "Level": 12, - "Margin": 2481.9210864494403, - "Lower": 1585132.0925854256, - "Upper": 1590095.9347583244 + "Margin": 2931.887805222318, + "Lower": 1583634.037324986, + "Upper": 1589497.8129354306 } }, "allocated_bytes": 0 @@ -1836,30 +1853,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 695.3365411758423, - 736.1013889312744, - 695.1441764831543, - 700.6739377975464, - 734.0443134307861, - 693.6513185501099, - 696.6545181274414, - 708.0808877944946, - 725.9366111755371, - 715.1745157241821, - 720.0009431838989, - 689.8867683410645 - ], - "Mean": 709.2238267262777, - "StandardError": 4.77465414473057, - "StandardDeviation": 16.53988713448534, + 649.8107109069824, + 660.3536996841431, + 668.1609945297241, + 650.4349708557129, + 647.68044090271, + 646.5535163879395, + 665.9830408096313, + 665.1769876480103, + 685.6862306594849, + 651.1280136108398, + 643.78480052948, + 655.0915241241455 + ], + "Mean": 657.487077554067, + "StandardError": 3.489116013008114, + "StandardDeviation": 12.086652416064409, "ConfidenceInterval": { "N": 12, - "Mean": 709.2238267262777, - "StandardError": 4.77465414473057, + "Mean": 657.487077554067, + "StandardError": 3.489116013008114, "Level": 12, - "Margin": 21.185041782192034, - "Lower": 688.0387849440857, - "Upper": 730.4088685084697 + "Margin": 15.48113565462515, + "Lower": 642.0059418994418, + "Upper": 672.9682132086922 } }, "allocated_bytes": 0 @@ -1870,31 +1887,32 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CDictionary\u003CString, Int32\u003E, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 703.3578157424927, - 705.5282983779907, - 695.6961154937744, - 692.3702554702759, - 714.0487031936646, - 720.1044960021973, - 704.8285799026489, - 680.0652742385864, - 706.5562810897827, - 701.2813091278076, - 708.4190845489502 - ], - "Mean": 702.9323830171065, - "StandardError": 3.249837361854989, - "StandardDeviation": 10.778491158951448, + 658.8120059967041, + 669.2054662704468, + 639.84255027771, + 638.289888381958, + 639.9594144821167, + 652.4378852844238, + 638.1233930587769, + 673.4310789108276, + 643.0130004882812, + 653.5747051239014, + 656.2810745239258, + 660.9482765197754 + ], + "Mean": 651.9932282765707, + "StandardError": 3.5428818993486675, + "StandardDeviation": 12.272902909776034, "ConfidenceInterval": { - "N": 11, - "Mean": 702.9323830171065, - "StandardError": 3.249837361854989, + "N": 12, + "Mean": 651.9932282765707, + "StandardError": 3.5428818993486675, "Level": 12, - "Margin": 14.906659032439942, - "Lower": 688.0257239846666, - "Upper": 717.8390420495465 + "Margin": 15.719693781361574, + "Lower": 636.2735344952091, + "Upper": 667.7129220579322 } }, "allocated_bytes": 0 @@ -1907,29 +1925,29 @@ "statistics": { "N": 11, "OriginalValues": [ - 628.4173727035522, - 628.5196933746338, - 626.1772708892822, - 626.4343662261963, - 625.0187559127808, - 626.3713045120239, - 627.0238161087036, - 626.4581680297852, - 626.6655130386353, - 626.8380479812622, - 625.6558103561401 - ], - "Mean": 626.6891017393632, - "StandardError": 0.31350937494049574, - "StandardDeviation": 1.039792964936474, + 622.4420070648193, + 622.9010419845581, + 622.3652362823486, + 622.825026512146, + 622.8054361343384, + 622.3361883163452, + 622.7155532836914, + 621.9821367263794, + 622.1128301620483, + 623.3336925506592, + 623.4331130981445 + ], + "Mean": 622.6592965559526, + "StandardError": 0.1401066775869485, + "StandardDeviation": 0.4646812801792047, "ConfidenceInterval": { "N": 11, - "Mean": 626.6891017393632, - "StandardError": 0.31350937494049574, + "Mean": 622.6592965559526, + "StandardError": 0.1401066775869485, "Level": 12, - "Margin": 1.4380342261324128, - "Lower": 625.2510675132307, - "Upper": 628.1271359654957 + "Margin": 0.6426544587955995, + "Lower": 622.0166420971569, + "Upper": 623.3019510147482 } }, "allocated_bytes": 0 @@ -1940,31 +1958,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CDictionary\u003CString, Int32\u003E, JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 748.7986087799072, - 746.6704454421997, - 750.0921487808228, - 705.5291738510132, - 744.7850704193115, - 745.0922727584839, - 757.3717432022095, - 693.8250064849854, - 735.2859973907471, - 746.6679019927979, - 742.2269983291626 - ], - "Mean": 737.8495788574219, - "StandardError": 5.966200364763656, - "StandardDeviation": 19.787648034002572, + 650.739312171936, + 648.4098834991455, + 668.8352823257446, + 683.8075723648071, + 644.8078947067261, + 681.029637336731, + 643.4052381515503, + 660.9218521118164, + 648.8608121871948, + 654.6349124908447, + 651.340763092041, + 648.5129995346069 + ], + "Mean": 657.1088466644287, + "StandardError": 3.9635933329847077, + "StandardDeviation": 13.730290066541562, "ConfidenceInterval": { - "N": 11, - "Mean": 737.8495788574219, - "StandardError": 5.966200364763656, + "N": 12, + "Mean": 657.1088466644287, + "StandardError": 3.9635933329847077, "Level": 12, - "Margin": 27.36632780478171, - "Lower": 710.4832510526402, - "Upper": 765.2159066622036 + "Margin": 17.586381719306107, + "Lower": 639.5224649451226, + "Upper": 674.6952283837348 } }, "allocated_bytes": 0 @@ -1977,30 +1996,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 689.0770988464355, - 672.6450128555298, - 668.4410572052002, - 688.746054649353, - 692.8842067718506, - 648.2021417617798, - 656.4861145019531, - 664.0223665237427, - 668.3259410858154, - 674.8491125106812, - 672.6059122085571, - 659.4874458312988 - ], - "Mean": 671.3143720626831, - "StandardError": 3.955105503214663, - "StandardDeviation": 13.700887361726135, + 643.5182886123657, + 629.2262077331543, + 641.0112380981445, + 633.0018444061279, + 624.1849269866943, + 628.2778587341309, + 624.316255569458, + 642.5447463989258, + 645.7715034484863, + 646.0465984344482, + 628.5419073104858, + 640.5801372528076 + ], + "Mean": 635.5851260821024, + "StandardError": 2.4402451971195487, + "StandardDeviation": 8.453257328673976, "ConfidenceInterval": { "N": 12, - "Mean": 671.3143720626831, - "StandardError": 3.955105503214663, + "Mean": 635.5851260821024, + "StandardError": 2.4402451971195487, "Level": 12, - "Margin": 17.548721393999198, - "Lower": 653.7656506686839, - "Upper": 688.8630934566823 + "Margin": 10.827317517191245, + "Lower": 624.7578085649112, + "Upper": 646.4124435992936 } }, "allocated_bytes": 0 @@ -2013,30 +2032,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 604.4726371765137, - 615.5181331634521, - 624.1079568862915, - 629.523754119873, - 622.2394304275513, - 622.5977334976196, - 626.2809429168701, - 628.2279090881348, - 612.6262340545654, - 630.9387283325195, - 629.6284198760986, - 621.0506353378296 - ], - "Mean": 622.26770957311, - "StandardError": 2.2926162009789306, - "StandardDeviation": 7.941855484702096, + 608.0522937774658, + 615.0704622268677, + 602.0713243484497, + 617.0683698654175, + 615.6022548675537, + 609.9657611846924, + 611.4998655319214, + 554.5957088470459, + 584.8095026016235, + 594.7596235275269, + 592.0400619506836, + 613.5760545730591 + ], + "Mean": 601.5926069418589, + "StandardError": 5.22201566387374, + "StandardDeviation": 18.089592895499674, "ConfidenceInterval": { "N": 12, - "Mean": 622.26770957311, - "StandardError": 2.2926162009789306, + "Mean": 601.5926069418589, + "StandardError": 5.22201566387374, "Level": 12, - "Margin": 10.172290711751593, - "Lower": 612.0954188613584, - "Upper": 632.4400002848615 + "Margin": 23.169975598864898, + "Lower": 578.422631342994, + "Upper": 624.7625825407238 } }, "allocated_bytes": 0 @@ -2047,31 +2066,32 @@ "method": "StjReflection", "job": "JsonSerializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Serialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 13.640650853514671, - 13.641328245401382, - 13.633884489536285, - 13.607467830181122, - 13.622282698750496, - 13.642489910125732, - 13.630228742957115, - 13.641343757510185, - 13.621673598885536, - 13.608958572149277, - 13.662774115800858 - ], - "Mean": 13.632098437710242, - "StandardError": 0.004905118820233271, - "StandardDeviation": 0.0162684386788245, + 13.652404770255089, + 13.656101509928703, + 13.651379063725471, + 13.620495185256004, + 13.625120118260384, + 13.632587477564812, + 13.618675991892815, + 13.646077990531921, + 13.612017035484314, + 13.624588653445244, + 13.682962715625763, + 13.63372865319252 + ], + "Mean": 13.63801159709692, + "StandardError": 0.005870641628894019, + "StandardDeviation": 0.020336499148546707, "ConfidenceInterval": { - "N": 11, - "Mean": 13.632098437710242, - "StandardError": 0.004905118820233271, + "N": 12, + "Mean": 13.63801159709692, + "StandardError": 0.005870641628894019, "Level": 12, - "Margin": 0.022499259386040648, - "Lower": 13.609599178324201, - "Upper": 13.654597697096284 + "Margin": 0.026047915603196803, + "Lower": 13.611963681493723, + "Upper": 13.664059512700117 } }, "allocated_bytes": 0 @@ -2082,32 +2102,31 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 13.710437968373299, - 13.712339103221893, - 13.703669115900993, - 13.703042030334473, - 13.671092078089714, - 13.706328347325325, - 13.70624515414238, - 13.702618569135666, - 13.700587064027786, - 13.706597819924355, - 13.681689888238907, - 13.682760298252106 - ], - "Mean": 13.698950619747242, - "StandardError": 0.003762479024167063, - "StandardDeviation": 0.013033609664539045, + 18.557635456323624, + 19.234256207942963, + 19.173053413629532, + 19.186640799045563, + 19.46171745657921, + 19.523723661899567, + 19.59131035208702, + 19.47978511452675, + 19.049640744924545, + 19.406047970056534, + 19.48383077979088 + ], + "Mean": 19.28614926880056, + "StandardError": 0.08961492069759046, + "StandardDeviation": 0.29721906757136174, "ConfidenceInterval": { - "N": 12, - "Mean": 13.698950619747242, - "StandardError": 0.003762479024167063, + "N": 11, + "Mean": 19.28614926880056, + "StandardError": 0.08961492069759046, "Level": 12, - "Margin": 0.01669404168667765, - "Lower": 13.682256578060564, - "Upper": 13.71564466143392 + "Margin": 0.41105412927360313, + "Lower": 18.87509513952696, + "Upper": 19.697203398074162 } }, "allocated_bytes": 0 @@ -2118,30 +2137,31 @@ "method": "StjSourceGen_FastPath", "job": "JsonSerializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen_FastPath: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 13.674428060650826, - 13.697373375296593, - 13.696881011128426, - 13.679982468485832, - 13.65474984049797, - 13.691997781395912, - 13.676003873348236, - 13.69648303091526, - 13.687603175640106, - 13.698231428861618 - ], - "Mean": 13.685373404622078, - "StandardError": 0.004457807977615606, - "StandardDeviation": 0.014096826580934214, + 13.607338070869446, + 13.618918746709824, + 13.621779784560204, + 13.60333463549614, + 13.603416576981544, + 13.585130989551544, + 13.592511415481567, + 13.594182819128036, + 13.593728959560394, + 13.589678958058357, + 13.598407313227654 + ], + "Mean": 13.600766206329519, + "StandardError": 0.0035185905552290787, + "StandardDeviation": 0.011669844662583133, "ConfidenceInterval": { - "N": 10, - "Mean": 13.685373404622078, - "StandardError": 0.004457807977615606, + "N": 11, + "Mean": 13.600766206329519, + "StandardError": 0.0035185905552290787, "Level": 12, - "Margin": 0.02131239025999019, - "Lower": 13.664061014362089, - "Upper": 13.706685794882068 + "Margin": 0.016139401404267506, + "Lower": 13.584626804925252, + "Upper": 13.616905607733786 } }, "allocated_bytes": 0 @@ -2152,30 +2172,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 8.264606192708015, - 8.272357910871506, - 8.27106149494648, - 8.271249011158943, - 8.2623430788517, - 8.260605856776237, - 8.267538622021675, - 8.259495720267296, - 8.26731014251709, - 8.277055487036705 - ], - "Mean": 8.267362351715565, - "StandardError": 0.0017890397476864077, - "StandardDeviation": 0.0056574404272620015, + 8.230174586176872, + 8.178723976016045, + 8.233361572027206, + 8.236392095685005, + 8.223809912800789, + 8.236998692154884, + 8.227814614772797, + 8.248018100857735, + 8.25888229906559, + 8.225676283240318, + 8.244374766945839, + 8.208206534385681 + ], + "Mean": 8.229369452844063, + "StandardError": 0.005921101598067168, + "StandardDeviation": 0.020511297609259214, "ConfidenceInterval": { - "N": 10, - "Mean": 8.267362351715565, - "StandardError": 0.0017890397476864077, + "N": 12, + "Mean": 8.229369452844063, + "StandardError": 0.005921101598067168, "Level": 12, - "Margin": 0.008553242644094645, - "Lower": 8.258809109071471, - "Upper": 8.27591559435966 + "Margin": 0.026271805443771133, + "Lower": 8.203097647400291, + "Upper": 8.255641258287834 } }, "allocated_bytes": 0 @@ -2186,32 +2208,31 @@ "method": "PolyTypeSourceGen", "job": "JsonSerializeBenchmark\u003CInt32, JsonBenchmarkWitness\u003E.Serialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 8.260379865765572, - 8.256138607859612, - 8.278320237994194, - 8.275172367691994, - 8.28472524881363, - 8.293554812669754, - 8.377419784665108, - 8.284284427762032, - 8.29254525899887, - 8.33626589179039, - 8.322438225150108, - 8.326467126607895 - ], - "Mean": 8.298975987980763, - "StandardError": 0.010171949136059193, - "StandardDeviation": 0.035236665431321736, + 8.257388442754745, + 8.233219385147095, + 8.23095192015171, + 8.2496268004179, + 8.255343273282051, + 8.255330219864845, + 8.259318768978119, + 8.25209853053093, + 8.255502209067345, + 8.249849081039429, + 8.253422886133194 + ], + "Mean": 8.25018650157885, + "StandardError": 0.002842825840049494, + "StandardDeviation": 0.009428586655771067, "ConfidenceInterval": { - "N": 12, - "Mean": 8.298975987980763, - "StandardError": 0.010171949136059193, + "N": 11, + "Mean": 8.25018650157885, + "StandardError": 0.002842825840049494, "Level": 12, - "Margin": 0.04513272813520325, - "Lower": 8.25384325984556, - "Upper": 8.344108716115965 + "Margin": 0.013039740383204556, + "Lower": 8.237146761195646, + "Upper": 8.263226241962055 } }, "allocated_bytes": 0 @@ -2224,30 +2245,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 8.45831073820591, - 8.451733127236366, - 8.442601814866066, - 8.464138954877853, - 8.469775930047035, - 8.469284817576408, - 8.46141141653061, - 8.468719825148582, - 8.47424753010273, - 8.458442360162735, - 8.448529988527298, - 8.465241640806198 - ], - "Mean": 8.461036512007317, - "StandardError": 0.0027556948043335615, - "StandardDeviation": 0.009546006822518608, + 8.42464466392994, + 8.431684836745262, + 8.445144951343536, + 8.446196094155312, + 8.445165425539017, + 8.443240076303482, + 8.443651720881462, + 8.432506889104843, + 8.435285344719887, + 8.440998703241348, + 8.43622162938118, + 8.44367903470993 + ], + "Mean": 8.4390349475046, + "StandardError": 0.001977741159296403, + "StandardDeviation": 0.006851096344243085, "ConfidenceInterval": { "N": 12, - "Mean": 8.461036512007317, - "StandardError": 0.0027556948043335615, + "Mean": 8.4390349475046, + "StandardError": 0.001977741159296403, "Level": 12, - "Margin": 0.012226960906310905, - "Lower": 8.448809551101006, - "Upper": 8.473263472913628 + "Margin": 0.00877519665802297, + "Lower": 8.430259750846577, + "Upper": 8.447810144162624 } }, "allocated_bytes": 0 @@ -2260,28 +2281,28 @@ "statistics": { "N": 10, "OriginalValues": [ - 794.1102981567383, - 795.7066297531128, - 796.1915330886841, - 800.6149139404297, - 797.0458669662476, - 797.6498603820801, - 798.6177997589111, - 795.0479192733765, - 795.2730264663696, - 815.8234357833862 - ], - "Mean": 798.6081283569335, - "StandardError": 2.0056590120989943, - "StandardDeviation": 6.342450687876032, + 793.0254545211792, + 793.4534549713135, + 793.3791084289551, + 794.3339347839355, + 793.1286888122559, + 792.5763521194458, + 791.9540004730225, + 791.7786436080933, + 795.3470945358276, + 791.1161584854126 + ], + "Mean": 793.009289073944, + "StandardError": 0.39395555416526395, + "StandardDeviation": 1.2457968480360682, "ConfidenceInterval": { "N": 10, - "Mean": 798.6081283569335, - "StandardError": 2.0056590120989943, + "Mean": 793.009289073944, + "StandardError": 0.39395555416526395, "Level": 12, - "Margin": 9.588880411395339, - "Lower": 789.0192479455382, - "Upper": 808.1970087683289 + "Margin": 1.8834670666886233, + "Lower": 791.1258220072555, + "Upper": 794.8927561406326 } }, "allocated_bytes": 0 @@ -2292,30 +2313,31 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CInt32[], JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 798.2543315887451, - 796.1216373443604, - 797.5512342453003, - 800.9785413742065, - 799.961009979248, - 798.2056140899658, - 801.4144496917725, - 814.3267240524292, - 801.7572965621948, - 800.6144762039185 - ], - "Mean": 800.9185315132141, - "StandardError": 1.600516423113362, - "StandardDeviation": 5.061277329543986, + 790.3216285705566, + 790.4995679855347, + 790.8918857574463, + 790.6650304794312, + 790.5341386795044, + 790.5560331344604, + 790.115514755249, + 790.5189990997314, + 790.3977632522583, + 790.1353044509888, + 790.6339168548584 + ], + "Mean": 790.4790711836381, + "StandardError": 0.06886692315298187, + "StandardDeviation": 0.22840574456467994, "ConfidenceInterval": { - "N": 10, - "Mean": 800.9185315132141, - "StandardError": 1.600516423113362, + "N": 11, + "Mean": 790.4790711836381, + "StandardError": 0.06886692315298187, "Level": 12, - "Margin": 7.651929109149464, - "Lower": 793.2666024040647, - "Upper": 808.5704606223636 + "Margin": 0.3158852667841756, + "Lower": 790.1631859168539, + "Upper": 790.7949564504223 } }, "allocated_bytes": 0 @@ -2328,29 +2350,29 @@ "statistics": { "N": 11, "OriginalValues": [ - 1068.1625995635986, - 1068.1118965148926, - 1070.737600326538, - 1068.4158000946045, - 1068.2515296936035, - 1068.894546508789, - 1069.5077571868896, - 1069.3442821502686, - 1068.0770874023438, - 1068.1112613677979, - 1067.6045417785645 - ], - "Mean": 1068.6562638716264, - "StandardError": 0.2711493281168374, - "StandardDeviation": 0.8993005835205133, + 1061.563808441162, + 1061.5575313568115, + 1062.1024780273438, + 1061.4937934875488, + 1061.8157386779785, + 1061.844825744629, + 1061.0307865142822, + 1061.1627101898193, + 1060.248296737671, + 1061.3056011199951, + 1061.8454627990723 + ], + "Mean": 1061.451912099665, + "StandardError": 0.15437206252901453, + "StandardDeviation": 0.5119942095220235, "ConfidenceInterval": { "N": 11, - "Mean": 1068.6562638716264, - "StandardError": 0.2711493281168374, + "Mean": 1061.451912099665, + "StandardError": 0.15437206252901453, "Level": 12, - "Margin": 1.2437331875604274, - "Lower": 1067.412530684066, - "Upper": 1069.8999970591867 + "Margin": 0.7080882653589231, + "Lower": 1060.743823834306, + "Upper": 1062.1600003650237 } }, "allocated_bytes": 0 @@ -2361,30 +2383,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CInt32[], JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 794.0533952713013, - 793.7238216400146, - 793.9395503997803, - 794.1937055587769, - 794.3885326385498, - 793.532133102417, - 794.2028846740723, - 794.6490440368652, - 794.6032285690308, - 796.2843179702759 - ], - "Mean": 794.3570613861084, - "StandardError": 0.2417446747281834, - "StandardDeviation": 0.7644637843576058, + 788.9082832336426, + 788.9648675918579, + 789.0733480453491, + 788.9509601593018, + 789.8056116104126, + 790.5517015457153, + 789.6747980117798, + 790.6989650726318, + 790.1161909103394, + 790.990948677063, + 790.6721429824829, + 790.5221376419067 + ], + "Mean": 789.9108296235403, + "StandardError": 0.22669312827895685, + "StandardDeviation": 0.7852880318117645, "ConfidenceInterval": { - "N": 10, - "Mean": 794.3570613861084, - "StandardError": 0.2417446747281834, + "N": 12, + "Mean": 789.9108296235403, + "StandardError": 0.22669312827895685, "Level": 12, - "Margin": 1.1557601576722065, - "Lower": 793.2013012284361, - "Upper": 795.5128215437807 + "Margin": 1.0058327260469087, + "Lower": 788.9049968974933, + "Upper": 790.9166623495872 } }, "allocated_bytes": 0 @@ -2395,30 +2419,32 @@ "method": "PolyTypeSourceGen", "job": "JsonSerializeBenchmark\u003CInt32[], JsonBenchmarkWitness\u003E.Serialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 796.7876996994019, - 794.1830949783325, - 793.0045919418335, - 794.9684457778931, - 793.710470199585, - 822.372317314148, - 801.5509843826294, - 794.0946025848389, - 794.0251426696777, - 794.4083213806152 - ], - "Mean": 797.9105670928955, - "StandardError": 2.8266078187884704, - "StandardDeviation": 8.938518759412052, + 790.6536254882812, + 790.6266450881958, + 790.2152938842773, + 790.0390625, + 790.1430521011353, + 789.9259328842163, + 789.5587291717529, + 789.9063034057617, + 789.0745010375977, + 789.4868450164795, + 788.9328393936157, + 790.0218162536621 + ], + "Mean": 789.8820538520813, + "StandardError": 0.15544377009927995, + "StandardDeviation": 0.5384730150640175, "ConfidenceInterval": { - "N": 10, - "Mean": 797.9105670928955, - "StandardError": 2.8266078187884704, + "N": 12, + "Mean": 789.8820538520813, + "StandardError": 0.15544377009927995, "Level": 12, - "Margin": 13.513764892623675, - "Lower": 784.3968022002717, - "Upper": 811.4243319855192 + "Margin": 0.6897007960187083, + "Lower": 789.1923530560626, + "Upper": 790.5717546481 } }, "allocated_bytes": 0 @@ -2429,29 +2455,31 @@ "method": "PolyTypeFastPath", "job": "JsonSerializeBenchmark\u003CInt32[], JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 9, + "N": 11, "OriginalValues": [ - 720.7014560699463, - 720.3965187072754, - 720.7074565887451, - 720.5526428222656, - 719.781756401062, - 719.5133371353149, - 721.7205762863159, - 720.7648754119873, - 720.5835580825806 - ], - "Mean": 720.5246863894993, - "StandardError": 0.20909668657685146, - "StandardDeviation": 0.6272900597305544, + 718.1696491241455, + 719.717264175415, + 718.5930414199829, + 717.6904678344727, + 717.3915309906006, + 717.6964683532715, + 717.6553802490234, + 717.9950084686279, + 718.5148792266846, + 716.883659362793, + 717.8508434295654 + ], + "Mean": 718.0143811485984, + "StandardError": 0.22437243332504592, + "StandardDeviation": 0.7441591746382114, "ConfidenceInterval": { - "N": 9, - "Mean": 720.5246863894993, - "StandardError": 0.20909668657685146, + "N": 11, + "Mean": 718.0143811485984, + "StandardError": 0.22437243332504592, "Level": 12, - "Margin": 1.0541202615667065, - "Lower": 719.4705661279326, - "Upper": 721.578806651066 + "Margin": 1.0291725361746167, + "Lower": 716.9852086124238, + "Upper": 719.0435536847731 } }, "allocated_bytes": 0 @@ -2462,31 +2490,32 @@ "method": "StjReflection", "job": "JsonSerializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Serialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 627.8935270309448, - 628.2997932434082, - 628.2606515884399, - 626.8637580871582, - 630.435625076294, - 630.1389541625977, - 627.1639261245728, - 628.3905906677246, - 625.6321268081665, - 627.4422407150269, - 625.7713241577148 - ], - "Mean": 627.8447743329135, - "StandardError": 0.46160827776820845, - "StandardDeviation": 1.5309814574793015, + 621.0727691650391, + 620.0005216598511, + 617.4914436340332, + 621.8298673629761, + 621.5048227310181, + 622.1101675033569, + 621.8673791885376, + 621.7816667556763, + 617.8855104446411, + 620.268027305603, + 617.0147657394409, + 620.9973096847534 + ], + "Mean": 620.3186875979105, + "StandardError": 0.5322995913972957, + "StandardDeviation": 1.8439398742965385, "ConfidenceInterval": { - "N": 11, - "Mean": 627.8447743329135, - "StandardError": 0.46160827776820845, + "N": 12, + "Mean": 620.3186875979105, + "StandardError": 0.5322995913972957, "Level": 12, - "Margin": 2.117348173791335, - "Lower": 625.7274261591222, - "Upper": 629.9621225067049 + "Margin": 2.3618022882015044, + "Lower": 617.956885309709, + "Upper": 622.680489886112 } }, "allocated_bytes": 312 @@ -2497,30 +2526,31 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 626.0234508514404, - 627.2434787750244, - 624.6137619018555, - 623.7652702331543, - 625.1351432800293, - 623.7754430770874, - 625.7110443115234, - 626.8122987747192, - 626.7252368927002, - 627.112229347229 - ], - "Mean": 625.6917357444763, - "StandardError": 0.4178672317009647, - "StandardDeviation": 1.3214122117243647, + 617.6463756561279, + 618.6875104904175, + 619.8338661193848, + 617.8404884338379, + 611.8548717498779, + 616.7815523147583, + 617.9687576293945, + 615.1032447814941, + 616.2445945739746, + 615.8529920578003, + 615.3703927993774 + ], + "Mean": 616.6531496914951, + "StandardError": 0.6486172329922376, + "StandardDeviation": 2.1512199943937795, "ConfidenceInterval": { - "N": 10, - "Mean": 625.6917357444763, - "StandardError": 0.4178672317009647, + "N": 11, + "Mean": 616.6531496914951, + "StandardError": 0.6486172329922376, "Level": 12, - "Margin": 1.9977867067383677, - "Lower": 623.693949037738, - "Upper": 627.6895224512147 + "Margin": 2.9751384017756175, + "Lower": 613.6780112897194, + "Upper": 619.6282880932707 } }, "allocated_bytes": 312 @@ -2531,31 +2561,32 @@ "method": "StjSourceGen_FastPath", "job": "JsonSerializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen_FastPath: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 499.21294021606445, - 498.6741943359375, - 500.04597568511963, - 497.2120122909546, - 499.67074394226074, - 499.19621086120605, - 499.92263317108154, - 500.5236473083496, - 500.28232765197754, - 498.8165292739868, - 500.37161445617676 - ], - "Mean": 499.44807538119227, - "StandardError": 0.2931718730439953, - "StandardDeviation": 0.9723411019726407, + 495.24227809906006, + 495.00175285339355, + 495.3560028076172, + 495.19383907318115, + 495.26917934417725, + 494.6586685180664, + 495.59152126312256, + 494.9793424606323, + 494.9573669433594, + 494.94926166534424, + 494.44715213775635, + 495.02285289764404 + ], + "Mean": 495.0557681719462, + "StandardError": 0.08857183676923956, + "StandardDeviation": 0.3068218428080403, "ConfidenceInterval": { - "N": 11, - "Mean": 499.44807538119227, - "StandardError": 0.2931718730439953, + "N": 12, + "Mean": 495.0557681719462, + "StandardError": 0.08857183676923956, "Level": 12, - "Margin": 1.3447482636097565, - "Lower": 498.1033271175825, - "Upper": 500.792823644802 + "Margin": 0.3929914095982583, + "Lower": 494.66277676234796, + "Upper": 495.4487595815445 } }, "allocated_bytes": 0 @@ -2568,30 +2599,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 560.536304473877, - 560.87366771698, - 559.6543951034546, - 560.5332450866699, - 558.1873655319214, - 559.5025625228882, - 559.2466192245483, - 560.2012071609497, - 559.3671007156372, - 561.0843896865845, - 560.7984457015991, - 558.9469270706177 - ], - "Mean": 559.9110191663107, - "StandardError": 0.25854773711754825, - "StandardDeviation": 0.8956356337391104, + 554.8741416931152, + 555.1434364318848, + 555.7947158813477, + 556.4452810287476, + 554.3009443283081, + 555.0704803466797, + 555.4455518722534, + 554.9105005264282, + 556.0193061828613, + 554.724534034729, + 554.3603897094727, + 556.2548236846924 + ], + "Mean": 555.27867547671, + "StandardError": 0.20640552878979374, + "StandardDeviation": 0.7150097256540867, "ConfidenceInterval": { "N": 12, - "Mean": 559.9110191663107, - "StandardError": 0.25854773711754825, + "Mean": 555.27867547671, + "StandardError": 0.20640552878979374, "Level": 12, - "Margin": 1.1471709672566335, - "Lower": 558.763848199054, - "Upper": 561.0581901335673 + "Margin": 0.9158170663131812, + "Lower": 554.3628584103968, + "Upper": 556.1944925430231 } }, "allocated_bytes": 0 @@ -2602,32 +2633,31 @@ "method": "PolyTypeSourceGen", "job": "JsonSerializeBenchmark\u003CLargePoco, JsonBenchmarkWitness\u003E.Serialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 548.1679039001465, - 545.8401041030884, - 548.1270151138306, - 548.9605665206909, - 547.579327583313, - 548.0218725204468, - 548.7896203994751, - 549.6298866271973, - 547.4222497940063, - 548.0719804763794, - 547.2521781921387, - 549.3357181549072 - ], - "Mean": 548.0998686154684, - "StandardError": 0.2971112104051413, - "StandardDeviation": 1.0292234238399833, + 548.6149396896362, + 548.6543970108032, + 550.114631652832, + 551.3046178817749, + 552.4974269866943, + 549.4606885910034, + 548.4822988510132, + 548.0140447616577, + 547.6933717727661, + 546.979546546936, + 547.4334955215454 + ], + "Mean": 549.0226781151512, + "StandardError": 0.5111797440796957, + "StandardDeviation": 1.6953914115422477, "ConfidenceInterval": { - "N": 12, - "Mean": 548.0998686154684, - "StandardError": 0.2971112104051413, + "N": 11, + "Mean": 549.0226781151512, + "StandardError": 0.5111797440796957, "Level": 12, - "Margin": 1.318276301402298, - "Lower": 546.7815923140661, - "Upper": 549.4181449168707 + "Margin": 2.3447272281147296, + "Lower": 546.6779508870364, + "Upper": 551.3674053432659 } }, "allocated_bytes": 0 @@ -2640,30 +2670,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 485.0542936325073, - 484.7346935272217, - 484.05659198760986, - 484.2860698699951, - 486.03717517852783, - 484.9679470062256, - 483.7781991958618, - 484.0816259384155, - 488.15182876586914, - 488.77104091644287, - 489.647665977478, - 492.24138259887695 - ], - "Mean": 486.3173762162526, - "StandardError": 0.7893872388688257, - "StandardDeviation": 2.7345176091346315, + 482.7544689178467, + 481.01691341400146, + 480.93918895721436, + 479.35275173187256, + 479.7420902252197, + 479.3240623474121, + 479.8922538757324, + 478.6131782531738, + 481.51902294158936, + 479.1264533996582, + 479.2782869338989, + 481.2059803009033 + ], + "Mean": 480.23038760821026, + "StandardError": 0.3566398560254657, + "StandardDeviation": 1.235436701280312, "ConfidenceInterval": { "N": 12, - "Mean": 486.3173762162526, - "StandardError": 0.7893872388688257, + "Mean": 480.23038760821026, + "StandardError": 0.3566398560254657, "Level": 12, - "Margin": 3.502494867868373, - "Lower": 482.81488134838423, - "Upper": 489.819871084121 + "Margin": 1.582403671988014, + "Lower": 478.64798393622226, + "Upper": 481.81279128019827 } }, "allocated_bytes": 0 @@ -2676,30 +2706,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 2541504.72265625, - 2525631.51171875, - 2522857.74609375, - 2544697.1015625, - 2563407.5546875, - 2546870.9296875, - 2527481.4453125, - 2523768.87890625, - 2524016.4375, - 2538405.2734375, - 2532850.5859375, - 2540189.78125 - ], - "Mean": 2535973.4973958335, - "StandardError": 3540.3934843614106, - "StandardDeviation": 12264.282787399545, + 2526234.86328125, + 2529406.0859375, + 2527965.65625, + 2525577.1484375, + 2523895.18359375, + 2528613.60546875, + 2531904.4609375, + 2522258.625, + 2515465.8203125, + 2514365.07421875, + 2516690.75390625, + 2515409.015625 + ], + "Mean": 2523148.857747396, + "StandardError": 1791.0641588113685, + "StandardDeviation": 6204.428245353805, "ConfidenceInterval": { "N": 12, - "Mean": 2535973.4973958335, - "StandardError": 3540.3934843614106, + "Mean": 2523148.857747396, + "StandardError": 1791.0641588113685, "Level": 12, - "Margin": 15708.652735480868, - "Lower": 2520264.8446603524, - "Upper": 2551682.1501313145 + "Margin": 7946.914664150321, + "Lower": 2515201.943083246, + "Upper": 2531095.772411546 } }, "allocated_bytes": 312 @@ -2710,32 +2740,31 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 2510332.84375, - 2500463.0546875, - 2499368.65234375, - 2500160.64453125, - 2514652.50390625, - 2495810.546875, - 2524200.1953125, - 2497478.3515625, - 2499909.1796875, - 2512743.9765625, - 2510109.69921875, - 2497086.09765625 - ], - "Mean": 2505192.978841146, - "StandardError": 2583.7072840744804, - "StandardDeviation": 8950.224575805589, + 2488902.5078125, + 2481869.3046875, + 2480801.26953125, + 2471172.69140625, + 2475314.12890625, + 2473601.23828125, + 2469916.83203125, + 2474799.31640625, + 2482830.2421875, + 2483459.3125, + 2477268.71484375 + ], + "Mean": 2478175.959872159, + "StandardError": 1767.8182932022166, + "StandardDeviation": 5863.189976078243, "ConfidenceInterval": { - "N": 12, - "Mean": 2505192.978841146, - "StandardError": 2583.7072840744804, + "N": 11, + "Mean": 2478175.959872159, + "StandardError": 1767.8182932022166, "Level": 12, - "Margin": 11463.855832674239, - "Lower": 2493729.123008472, - "Upper": 2516656.83467382 + "Margin": 8108.794869978866, + "Lower": 2470067.1650021803, + "Upper": 2486284.754742138 } }, "allocated_bytes": 312 @@ -2748,30 +2777,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1998978.6796875, - 2014904.78515625, - 2018343.1015625, - 2010859.5390625, - 2005894.859375, - 2019844.5625, - 2071576.66015625, - 2110710.61328125, - 2110203.2890625, - 2107601.07421875, - 2017805.33984375, - 2007808.10546875 - ], - "Mean": 2041210.8841145833, - "StandardError": 12970.513756014563, - "StandardDeviation": 44931.17765137651, + 2008654.94921875, + 2013891.27734375, + 2017833.49609375, + 2016607.91015625, + 2017847.4921875, + 2012129.234375, + 2011943.359375, + 2016282.5546875, + 1987528.484375, + 2006861.328125, + 2008690.1015625, + 2006004.8828125 + ], + "Mean": 2010356.255859375, + "StandardError": 2403.1502405874135, + "StandardDeviation": 8324.756629837542, "ConfidenceInterval": { "N": 12, - "Mean": 2041210.8841145833, - "StandardError": 12970.513756014563, + "Mean": 2010356.255859375, + "StandardError": 2403.1502405874135, "Level": 12, - "Margin": 57549.90152761541, - "Lower": 1983660.9825869678, - "Upper": 2098760.7856421988 + "Margin": 10662.727961545801, + "Lower": 1999693.5278978292, + "Upper": 2021018.9838209208 } }, "allocated_bytes": 0 @@ -2782,32 +2811,31 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 2268719.56640625, - 2363874.34765625, - 2310634.9296875, - 2316093.09765625, - 2296789.0625, - 2351635.90234375, - 2288612.14453125, - 2309047.69140625, - 2360827.80078125, - 2309327.796875, - 2311607.2578125, - 2345683.43359375 - ], - "Mean": 2319404.4192708335, - "StandardError": 8620.344010222261, - "StandardDeviation": 29861.747608854002, + 2243118.328125, + 2238071.2890625, + 2245755.69921875, + 2244253.90625, + 2241534.66796875, + 2243386.39453125, + 2239962.078125, + 2243350.74609375, + 2235511.39453125, + 2240166.9921875, + 2242609.046875 + ], + "Mean": 2241610.9584517046, + "StandardError": 895.21471158144, + "StandardDeviation": 2969.091305121863, "ConfidenceInterval": { - "N": 12, - "Mean": 2319404.4192708335, - "StandardError": 8620.344010222261, + "N": 11, + "Mean": 2241610.9584517046, + "StandardError": 895.21471158144, "Level": 12, - "Margin": 38248.28825245366, - "Lower": 2281156.1310183797, - "Upper": 2357652.7075232873 + "Margin": 4106.2548615514515, + "Lower": 2237504.7035901533, + "Upper": 2245717.213313256 } }, "allocated_bytes": 0 @@ -2820,30 +2848,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 2240923.9921875, - 2246755.859375, - 2249062.3359375, - 2245514.16015625, - 2240477.86328125, - 2241704.42578125, - 2248701.171875, - 2248013.18359375, - 2241713.5390625, - 2240446.125, - 2236466.9609375, - 2247953.125 - ], - "Mean": 2243977.728515625, - "StandardError": 1203.1654348071152, - "StandardDeviation": 4167.887325993246, + 2173271.97265625, + 2173229.328125, + 2178186.5234375, + 2181819.0078125, + 2173716.95703125, + 2170579.58984375, + 2181556.31640625, + 2172316.734375, + 2172397.4609375, + 2184208.82421875, + 2177822.58984375, + 2177634.27734375 + ], + "Mean": 2176394.965169271, + "StandardError": 1282.9786918339905, + "StandardDeviation": 4444.36855856945, "ConfidenceInterval": { "N": 12, - "Mean": 2243977.728515625, - "StandardError": 1203.1654348071152, + "Mean": 2176394.965169271, + "StandardError": 1282.9786918339905, "Level": 12, - "Margin": 5338.420173408458, - "Lower": 2238639.3083422165, - "Upper": 2249316.1486890335 + "Margin": 5692.549945667094, + "Lower": 2170702.415223604, + "Upper": 2182087.515114938 } }, "allocated_bytes": 0 @@ -2854,31 +2882,32 @@ "method": "PolyTypeFastPath", "job": "JsonSerializeBenchmark\u003CLargePoco[], JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 1982564.12890625, - 1985692.21875, - 1983504.06640625, - 1980106.76953125, - 1983997.72265625, - 1985618.98046875, - 1984450.51953125, - 1984197.1015625, - 1981985.19140625, - 1981659.015625, - 1977661.1328125 - ], - "Mean": 1982857.8952414773, - "StandardError": 729.6568694615177, - "StandardDeviation": 2419.9980617091833, + 1976947.9140625, + 1977994.95703125, + 1975745.27734375, + 1975631.8359375, + 1969649.25, + 1972646.15625, + 1972356.76953125, + 1974740.0703125, + 1972244.953125, + 1966182.6171875, + 1970749.671875, + 1981320.4765625 + ], + "Mean": 1973850.8291015625, + "StandardError": 1175.6598390592376, + "StandardDeviation": 4072.6051473376974, "ConfidenceInterval": { - "N": 11, - "Mean": 1982857.8952414773, - "StandardError": 729.6568694615177, + "N": 12, + "Mean": 1973850.8291015625, + "StandardError": 1175.6598390592376, "Level": 12, - "Margin": 3346.8586124974568, - "Lower": 1979511.0366289797, - "Upper": 1986204.7538539749 + "Margin": 5216.378413419212, + "Lower": 1968634.4506881433, + "Upper": 1979067.2075149817 } }, "allocated_bytes": 0 @@ -2891,30 +2920,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 869.3393869400024, - 869.9471950531006, - 869.7001543045044, - 870.4870939254761, - 870.0813455581665, - 869.9809312820435, - 869.6969747543335, - 869.5147438049316, - 869.3594932556152, - 869.2239122390747, - 869.648775100708, - 869.9099617004395 - ], - "Mean": 869.7408306598663, - "StandardError": 0.1043974945329404, - "StandardDeviation": 0.3616435294278937, + 864.3137216567993, + 864.5083503723145, + 864.0788793563843, + 864.333987236023, + 865.3317289352417, + 864.2091751098633, + 864.6343154907227, + 863.9198141098022, + 864.725549697876, + 864.8196849822998, + 865.239580154419, + 864.4917802810669 + ], + "Mean": 864.550547281901, + "StandardError": 0.12432051169891646, + "StandardDeviation": 0.4306588853709686, "ConfidenceInterval": { "N": 12, - "Mean": 869.7408306598663, - "StandardError": 0.1043974945329404, + "Mean": 864.550547281901, + "StandardError": 0.12432051169891646, "Level": 12, - "Margin": 0.4632095260925563, - "Lower": 869.2776211337738, - "Upper": 870.2040401859589 + "Margin": 0.5516075415916138, + "Lower": 863.9989397403094, + "Upper": 865.1021548234926 } }, "allocated_bytes": 0 @@ -2925,32 +2954,31 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CList\u003CInt32\u003E, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 881.3560400009155, - 882.3998775482178, - 881.2244329452515, - 886.563777923584, - 884.7059803009033, - 890.2716236114502, - 894.5646286010742, - 895.3595561981201, - 907.3708457946777, - 897.8931503295898, - 870.3610496520996, - 868.8922719955444 - ], - "Mean": 886.7469362417856, - "StandardError": 3.2183691265109746, - "StandardDeviation": 11.14875768925615, + 864.4541110992432, + 864.5898103713989, + 863.7299938201904, + 863.3078336715698, + 864.2885293960571, + 863.582968711853, + 862.8588523864746, + 864.1447219848633, + 863.6002140045166, + 863.534252166748, + 864.2939720153809 + ], + "Mean": 863.8532054207542, + "StandardError": 0.16271982790251327, + "StandardDeviation": 0.5396806151038398, "ConfidenceInterval": { - "N": 12, - "Mean": 886.7469362417856, - "StandardError": 3.2183691265109746, + "N": 11, + "Mean": 863.8532054207542, + "StandardError": 0.16271982790251327, "Level": 12, - "Margin": 14.279837313640504, - "Lower": 872.4670989281451, - "Upper": 901.0267735554262 + "Margin": 0.7463785790731227, + "Lower": 863.106826841681, + "Upper": 864.5995839998274 } }, "allocated_bytes": 0 @@ -2963,29 +2991,29 @@ "statistics": { "N": 11, "OriginalValues": [ - 997.8501796722412, - 999.5385799407959, - 1001.8091201782227, - 1012.515625, - 1010.8451061248779, - 998.972972869873, - 1003.3131427764893, - 1003.8135051727295, - 998.6969623565674, - 1004.3275356292725, - 1007.8684482574463 - ], - "Mean": 1003.5955616344105, - "StandardError": 1.5047455864271517, - "StandardDeviation": 4.990676515122165, + 986.4259548187256, + 986.3487091064453, + 987.169584274292, + 988.0438652038574, + 986.4476528167725, + 984.5541324615479, + 986.623685836792, + 986.4103012084961, + 986.9821853637695, + 986.1671142578125, + 986.3380584716797 + ], + "Mean": 986.5010221654719, + "StandardError": 0.2530226088272547, + "StandardDeviation": 0.8391810569568698, "ConfidenceInterval": { "N": 11, - "Mean": 1003.5955616344105, - "StandardError": 1.5047455864271517, + "Mean": 986.5010221654719, + "StandardError": 0.2530226088272547, "Level": 12, - "Margin": 6.9021082872390584, - "Lower": 996.6934533471715, - "Upper": 1010.4976699216495 + "Margin": 1.1605878501973517, + "Lower": 985.3404343152746, + "Upper": 987.6616100156692 } }, "allocated_bytes": 0 @@ -2996,30 +3024,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CList\u003CInt32\u003E, JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 921.7743473052979, - 922.9522943496704, - 922.0291376113892, - 924.540638923645, - 923.3686122894287, - 928.492546081543, - 924.7790575027466, - 929.8779172897339, - 921.3437242507935, - 924.6327075958252 - ], - "Mean": 924.3790983200073, - "StandardError": 0.8943354667415735, - "StandardDeviation": 2.8281370671731385, + 915.0100545883179, + 916.8457584381104, + 916.441162109375, + 916.6429443359375, + 916.4507389068604, + 915.7362775802612, + 914.5852327346802, + 915.8213138580322, + 915.4369440078735, + 914.2260160446167, + 915.1609745025635, + 916.569034576416 + ], + "Mean": 915.743870973587, + "StandardError": 0.2509693514649822, + "StandardDeviation": 0.8693833357599197, "ConfidenceInterval": { - "N": 10, - "Mean": 924.3790983200073, - "StandardError": 0.8943354667415735, + "N": 12, + "Mean": 915.743870973587, + "StandardError": 0.2509693514649822, "Level": 12, - "Margin": 4.275739687814445, - "Lower": 920.1033586321929, - "Upper": 928.6548380078217 + "Margin": 1.1135458267072682, + "Lower": 914.6303251468797, + "Upper": 916.8574168002943 } }, "allocated_bytes": 0 @@ -3032,30 +3062,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 1129.1143894195557, - 1131.2968730926514, - 1132.2858333587646, - 1149.7821006774902, - 1157.312313079834, - 1151.7088413238525, - 1142.594497680664, - 1140.6092643737793, - 1156.7977275848389, - 1140.8323440551758, - 1164.546012878418, - 1161.9079113006592 - ], - "Mean": 1146.5656757354736, - "StandardError": 3.526283526245705, - "StandardDeviation": 12.215404458701403, + 937.6077251434326, + 937.2283220291138, + 938.3545322418213, + 937.2062282562256, + 936.728437423706, + 937.4357852935791, + 936.7208480834961, + 936.5123910903931, + 936.6701040267944, + 937.3553190231323, + 938.4270906448364, + 937.8525018692017 + ], + "Mean": 937.341607093811, + "StandardError": 0.1841478533782076, + "StandardDeviation": 0.6379068763115994, "ConfidenceInterval": { "N": 12, - "Mean": 1146.5656757354736, - "StandardError": 3.526283526245705, + "Mean": 937.341607093811, + "StandardError": 0.1841478533782076, "Level": 12, - "Margin": 15.646047142873476, - "Lower": 1130.9196285926002, - "Upper": 1162.211722878347 + "Margin": 0.8170602204190522, + "Lower": 936.524546873392, + "Upper": 938.1586673142301 } }, "allocated_bytes": 0 @@ -3066,32 +3096,30 @@ "method": "PolyTypeFastPath", "job": "JsonSerializeBenchmark\u003CList\u003CInt32\u003E, JsonBenchmarkWitness\u003E.\u0027PolyType fast path\u0027: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 10, "OriginalValues": [ - 784.8608493804932, - 781.1414003372192, - 782.1946144104004, - 781.7587451934814, - 782.3203411102295, - 784.093578338623, - 788.1777687072754, - 786.5097131729126, - 786.5512762069702, - 783.5727138519287, - 785.63352394104, - 782.444953918457 - ], - "Mean": 784.1049565474192, - "StandardError": 0.6479786658954904, - "StandardDeviation": 2.2446639431033755, + 778.7730293273926, + 778.5485982894897, + 778.240044593811, + 777.7866125106812, + 778.4527931213379, + 777.8398599624634, + 777.9662609100342, + 778.3565921783447, + 778.0953645706177, + 778.2857809066772 + ], + "Mean": 778.2344936370849, + "StandardError": 0.10008581160819123, + "StandardDeviation": 0.3164991261484042, "ConfidenceInterval": { - "N": 12, - "Mean": 784.1049565474192, - "StandardError": 0.6479786658954904, + "N": 10, + "Mean": 778.2344936370849, + "StandardError": 0.10008581160819123, "Level": 12, - "Margin": 2.875067951490264, - "Lower": 781.229888595929, - "Upper": 786.9800244989094 + "Margin": 0.4785015162592455, + "Lower": 777.7559921208257, + "Upper": 778.7129951533442 } }, "allocated_bytes": 0 @@ -3102,32 +3130,30 @@ "method": "StjReflection", "job": "JsonSerializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Serialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 10, "OriginalValues": [ - 145.86129784584045, - 145.7650761604309, - 145.61640238761902, - 154.17951345443726, - 153.3140938282013, - 164.06142711639404, - 165.6718451976776, - 150.9479284286499, - 163.14786672592163, - 150.9992778301239, - 145.42196202278137, - 143.51242780685425 - ], - "Mean": 152.37492656707764, - "StandardError": 2.2965531035281344, - "StandardDeviation": 7.955493315181433, + 149.26311373710632, + 146.0958321094513, + 146.41465759277344, + 147.0317840576172, + 145.78332495689392, + 146.98110032081604, + 146.55423164367676, + 146.64313197135925, + 145.65770816802979, + 146.75663924217224 + ], + "Mean": 146.71815237998962, + "StandardError": 0.3189592434556118, + "StandardDeviation": 1.0086376900838885, "ConfidenceInterval": { - "N": 12, - "Mean": 152.37492656707764, - "StandardError": 2.2965531035281344, + "N": 10, + "Mean": 146.71815237998962, + "StandardError": 0.3189592434556118, "Level": 12, - "Margin": 10.18975866701477, - "Lower": 142.18516790006288, - "Upper": 162.5646852340924 + "Margin": 1.5249162610169722, + "Lower": 145.19323611897264, + "Upper": 148.2430686410066 } }, "allocated_bytes": 312 @@ -3138,31 +3164,30 @@ "method": "StjSourceGen", "job": "JsonSerializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 10, "OriginalValues": [ - 140.5581135749817, - 139.07235860824585, - 140.3555769920349, - 142.93502759933472, - 139.62261867523193, - 141.30560564994812, - 138.56019568443298, - 137.86711287498474, - 140.82613587379456, - 138.6050283908844, - 139.90294933319092 - ], - "Mean": 139.9646112051877, - "StandardError": 0.43699580944935806, - "StandardDeviation": 1.4493511349011654, + 138.61251878738403, + 139.14702320098877, + 138.04015517234802, + 138.98822665214539, + 137.55226135253906, + 139.30855202674866, + 138.5932960510254, + 137.85546016693115, + 139.38654470443726, + 138.87754082679749 + ], + "Mean": 138.63615789413453, + "StandardError": 0.2000092100776164, + "StandardDeviation": 0.6324846568563707, "ConfidenceInterval": { - "N": 11, - "Mean": 139.9646112051877, - "StandardError": 0.43699580944935806, + "N": 10, + "Mean": 138.63615789413453, + "StandardError": 0.2000092100776164, "Level": 12, - "Margin": 2.0044533940456755, - "Lower": 137.96015781114204, - "Upper": 141.96906459923338 + "Margin": 0.9562265494994571, + "Lower": 137.67993134463507, + "Upper": 139.592384443634 } }, "allocated_bytes": 312 @@ -3173,32 +3198,31 @@ "method": "StjSourceGen_FastPath", "job": "JsonSerializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Serialize_StjSourceGen_FastPath: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 12, + "N": 11, "OriginalValues": [ - 67.84897553920746, - 67.7670191526413, - 67.99615919589996, - 67.86698603630066, - 67.75418424606323, - 67.73422157764435, - 67.57136678695679, - 67.85460805892944, - 67.89507472515106, - 67.62493145465851, - 67.80975067615509, - 67.76712834835052 - ], - "Mean": 67.79086714982986, - "StandardError": 0.033484039839319586, - "StandardDeviation": 0.11599211648872389, + 66.4022763967514, + 66.07262289524078, + 66.31184613704681, + 66.35009741783142, + 66.3169275522232, + 66.34315848350525, + 66.2913670539856, + 66.19960069656372, + 66.34775793552399, + 66.30629801750183, + 66.39785075187683 + ], + "Mean": 66.30361848527735, + "StandardError": 0.028423080126683133, + "StandardDeviation": 0.09426869216641517, "ConfidenceInterval": { - "N": 12, - "Mean": 67.79086714982986, - "StandardError": 0.033484039839319586, + "N": 11, + "Mean": 66.30361848527735, + "StandardError": 0.028423080126683133, "Level": 12, - "Margin": 0.14856799289126246, - "Lower": 67.6422991569386, - "Upper": 67.93943514272112 + "Margin": 0.13037365163970657, + "Lower": 66.17324483363765, + "Upper": 66.43399213691706 } }, "allocated_bytes": 0 @@ -3209,30 +3233,32 @@ "method": "PolyTypeReflection", "job": "JsonSerializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Serialize_PolyTypeReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 12, "OriginalValues": [ - 92.24885201454163, - 92.11045503616333, - 92.15883421897888, - 92.11131930351257, - 92.14508032798767, - 92.07590925693512, - 92.15105068683624, - 92.13334321975708, - 92.07454812526703, - 92.0076916217804 - ], - "Mean": 92.12170838117599, - "StandardError": 0.020177672274183107, - "StandardDeviation": 0.06380740226684814, + 86.87257266044617, + 86.92341542243958, + 86.95158863067627, + 86.89026045799255, + 86.82845532894135, + 86.77917718887329, + 86.85047435760498, + 87.6526882648468, + 88.04930746555328, + 87.77281641960144, + 87.66524994373322, + 87.61817705631256 + ], + "Mean": 87.23784859975179, + "StandardError": 0.13504117745866198, + "StandardDeviation": 0.46779636094465504, "ConfidenceInterval": { - "N": 10, - "Mean": 92.12170838117599, - "StandardError": 0.020177672274183107, + "N": 12, + "Mean": 87.23784859975179, + "StandardError": 0.13504117745866198, "Level": 12, - "Margin": 0.09646768730392716, - "Lower": 92.02524069387206, - "Upper": 92.21817606847992 + "Margin": 0.5991749140480622, + "Lower": 86.63867368570372, + "Upper": 87.83702351379985 } }, "allocated_bytes": 0 @@ -3243,30 +3269,31 @@ "method": "PolyTypeSourceGen", "job": "JsonSerializeBenchmark\u003CMyPoco, JsonBenchmarkWitness\u003E.Serialize_PolyTypeSourceGen: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 10, + "N": 11, "OriginalValues": [ - 90.95326066017151, - 91.03229141235352, - 90.77429282665253, - 90.84049367904663, - 91.05986857414246, - 90.92999005317688, - 90.88871371746063, - 91.28217399120331, - 91.162770986557, - 90.90094268321991 - ], - "Mean": 90.98247985839843, - "StandardError": 0.04868754403747104, - "StandardDeviation": 0.15396353283815886, + 89.60233628749847, + 89.47499096393585, + 89.51332175731659, + 89.6978577375412, + 89.4256284236908, + 89.44565057754517, + 89.39482760429382, + 89.36274540424347, + 89.41807842254639, + 89.40521383285522, + 89.32735025882721 + ], + "Mean": 89.46072738820857, + "StandardError": 0.032661646420797885, + "StandardDeviation": 0.10832642621304098, "ConfidenceInterval": { - "N": 10, - "Mean": 90.98247985839843, - "StandardError": 0.04868754403747104, + "N": 11, + "Mean": 89.46072738820857, + "StandardError": 0.032661646420797885, "Level": 12, - "Margin": 0.23277089200285805, - "Lower": 90.74970896639557, - "Upper": 91.2152507504013 + "Margin": 0.1498155053381011, + "Lower": 89.31091188287047, + "Upper": 89.61054289354666 } }, "allocated_bytes": 0 @@ -3279,30 +3306,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 65.90614712238312, - 65.37837278842926, - 66.40426313877106, - 66.33671116828918, - 66.21350347995758, - 66.05129933357239, - 66.30480289459229, - 66.20344519615173, - 66.36552011966705, - 65.94523286819458, - 66.46080315113068, - 66.29618501663208 - ], - "Mean": 66.15552385648091, - "StandardError": 0.0870805715619968, - "StandardDeviation": 0.3016559485950319, + 66.81948900222778, + 66.64213037490845, + 66.4898852109909, + 66.53393805027008, + 66.64179265499115, + 66.78573286533356, + 66.72922265529633, + 66.75778329372406, + 66.68913865089417, + 66.80253148078918, + 66.7195816040039, + 66.77873933315277 + ], + "Mean": 66.6991637647152, + "StandardError": 0.030337496361267407, + "StandardDeviation": 0.10509217014430217, "ConfidenceInterval": { "N": 12, - "Mean": 66.15552385648091, - "StandardError": 0.0870805715619968, + "Mean": 66.6991637647152, + "StandardError": 0.030337496361267407, "Level": 12, - "Margin": 0.3863746966875162, - "Lower": 65.7691491597934, - "Upper": 66.54189855316842 + "Margin": 0.1346068444957108, + "Lower": 66.56455692021949, + "Upper": 66.8337706092109 } }, "allocated_bytes": 0 @@ -3313,31 +3340,32 @@ "method": "StjReflection", "job": "JsonSerializeBenchmark\u003CString, JsonBenchmarkWitness\u003E.Serialize_StjReflection: Job-DRYOBN(IterationCount=12, LaunchCount=1, WarmupCount=6)", "statistics": { - "N": 11, + "N": 12, "OriginalValues": [ - 17.046311229467392, - 17.067069798707962, - 17.11079230904579, - 17.084286868572235, - 17.066311091184616, - 17.056523501873016, - 17.083636164665222, - 17.091629415750504, - 17.078332602977753, - 17.09373915195465, - 17.086267471313477 - ], - "Mean": 17.078627236864783, - "StandardError": 0.005531529903496093, - "StandardDeviation": 0.018346009206527354, + 16.916458815336227, + 16.8973890542984, + 16.924017429351807, + 16.91257330775261, + 16.886697471141815, + 16.906239092350006, + 16.906671226024628, + 16.90818989276886, + 16.912026941776276, + 16.919051587581635, + 16.896136105060577, + 16.920074820518494 + ], + "Mean": 16.908793811996777, + "StandardError": 0.00318336423369729, + "StandardDeviation": 0.011027497183522542, "ConfidenceInterval": { - "N": 11, - "Mean": 17.078627236864783, - "StandardError": 0.005531529903496093, + "N": 12, + "Mean": 16.908793811996777, + "StandardError": 0.00318336423369729, "Level": 12, - "Margin": 0.025372540536027284, - "Lower": 17.053254696328757, - "Upper": 17.10399977740081 + "Margin": 0.014124521327527147, + "Lower": 16.89466929066925, + "Upper": 16.922918333324304 } }, "allocated_bytes": 0 @@ -3350,30 +3378,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 17.15720197558403, - 17.153939843177795, - 17.18171066045761, - 17.15431734919548, - 17.166361212730408, - 17.1688050031662, - 17.12466898560524, - 17.166002333164215, - 17.15433970093727, - 17.15865856409073, - 17.16529205441475, - 17.156333953142166 - ], - "Mean": 17.158969302972157, - "StandardError": 0.0039051612775268855, - "StandardDeviation": 0.0135278754888543, + 16.969751566648483, + 16.948749601840973, + 17.047427594661713, + 17.02321320772171, + 17.00790846347809, + 17.014317214488983, + 17.0096333026886, + 17.016585916280746, + 17.020917177200317, + 16.96866998076439, + 16.992442309856415, + 16.99526733160019 + ], + "Mean": 17.00124030560255, + "StandardError": 0.0079987571414519, + "StandardDeviation": 0.02770850753279817, "ConfidenceInterval": { "N": 12, - "Mean": 17.158969302972157, - "StandardError": 0.0039051612775268855, + "Mean": 17.00124030560255, + "StandardError": 0.0079987571414519, "Level": 12, - "Margin": 0.01732711989661273, - "Lower": 17.141642183075543, - "Upper": 17.17629642286877 + "Margin": 0.03549032015947777, + "Lower": 16.965749985443072, + "Upper": 17.03673062576203 } }, "allocated_bytes": 0 @@ -3386,29 +3414,29 @@ "statistics": { "N": 11, "OriginalValues": [ - 17.021159321069717, - 17.05554249882698, - 17.093078553676605, - 17.058633267879486, - 17.039615660905838, - 17.021114617586136, - 17.04517751932144, - 17.060499638319016, - 17.035022377967834, - 17.04055941104889, - 17.017622768878937 - ], - "Mean": 17.0443659668619, - "StandardError": 0.006661334188660739, - "StandardDeviation": 0.02209314610695418, + 16.923539340496063, + 16.89773052930832, + 16.961532324552536, + 16.913438826799393, + 16.91536232829094, + 16.91378402709961, + 16.95437979698181, + 16.893333435058594, + 16.890350729227066, + 16.915466636419296, + 16.914042353630066 + ], + "Mean": 16.917541847987607, + "StandardError": 0.006807962080146915, + "StandardDeviation": 0.022579455806814773, "ConfidenceInterval": { "N": 11, - "Mean": 17.0443659668619, - "StandardError": 0.006661334188660739, + "Mean": 16.917541847987607, + "StandardError": 0.006807962080146915, "Level": 12, - "Margin": 0.030554832871643064, - "Lower": 17.013811133990256, - "Upper": 17.074920799733544 + "Margin": 0.031227399446415418, + "Lower": 16.886314448541192, + "Upper": 16.948769247434022 } }, "allocated_bytes": 0 @@ -3421,30 +3449,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 11.933419853448868, - 11.87955091893673, - 11.814452081918716, - 11.858011290431023, - 11.841972678899765, - 11.868598565459251, - 11.891499787569046, - 12.07089176774025, - 12.02668870985508, - 12.011460959911346, - 11.933619156479836, - 12.003519877791405 - ], - "Mean": 11.92780713737011, - "StandardError": 0.02388218627736557, - "StandardDeviation": 0.08273032005644279, + 11.793384328484535, + 11.768760785460472, + 11.782785877585411, + 11.783196285367012, + 11.778981730341911, + 11.765864983201027, + 11.751225218176842, + 11.787540599703789, + 11.763997375965118, + 11.75961084663868, + 11.794935911893845, + 11.770988509058952 + ], + "Mean": 11.775106037656466, + "StandardError": 0.003986531688468977, + "StandardDeviation": 0.01380975086082322, "ConfidenceInterval": { "N": 12, - "Mean": 11.92780713737011, - "StandardError": 0.02388218627736557, + "Mean": 11.775106037656466, + "StandardError": 0.003986531688468977, "Level": 12, - "Margin": 0.10596476703856275, - "Lower": 11.821842370331547, - "Upper": 12.033771904408672 + "Margin": 0.017688158728617936, + "Lower": 11.757417878927848, + "Upper": 11.792794196385083 } }, "allocated_bytes": 0 @@ -3457,30 +3485,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 11.625764891505241, - 11.646550759673119, - 11.61615177989006, - 11.623337253928185, - 11.591201648116112, - 11.57313585281372, - 11.610633373260498, - 11.598827943205833, - 11.630792170763016, - 11.643161997199059, - 11.621472746133804, - 11.622103556990623 - ], - "Mean": 11.616927831123272, - "StandardError": 0.006075279181208048, - "StandardDeviation": 0.021045384424035574, + 12.00942012667656, + 12.019782021641731, + 12.009035184979439, + 12.071015313267708, + 12.135917320847511, + 12.135539203882217, + 12.104127556085587, + 12.067798525094986, + 12.102603912353516, + 11.963088065385818, + 12.1089878231287, + 12.085414171218872 + ], + "Mean": 12.06772743538022, + "StandardError": 0.016027526566326715, + "StandardDeviation": 0.055520980665075645, "ConfidenceInterval": { "N": 12, - "Mean": 11.616927831123272, - "StandardError": 0.006075279181208048, + "Mean": 12.06772743538022, + "StandardError": 0.016027526566326715, "Level": 12, - "Margin": 0.026955888194418454, - "Lower": 11.589971942928853, - "Upper": 11.64388371931769 + "Margin": 0.0711138042003636, + "Lower": 11.996613631179857, + "Upper": 12.138841239580584 } }, "allocated_bytes": 0 @@ -3493,30 +3521,30 @@ "statistics": { "N": 12, "OriginalValues": [ - 12.676239013671875, - 12.715431556105614, - 12.651318073272705, - 12.62315921485424, - 12.641989946365356, - 12.63904944062233, - 12.831247717142105, - 12.83041201531887, - 12.857147797942162, - 12.797774747014046, - 12.899651497602463, - 12.71064455807209 - ], - "Mean": 12.739505464831987, - "StandardError": 0.02832331266158288, - "StandardDeviation": 0.09811483313704086, + 13.718393325805664, + 13.462536036968231, + 13.34567429125309, + 13.558745384216309, + 13.48504051566124, + 13.340895369648933, + 13.5620838701725, + 13.219641521573067, + 13.867345318198204, + 13.833974182605743, + 13.62694427371025, + 13.480957597494125 + ], + "Mean": 13.541852640608946, + "StandardError": 0.05682902771530213, + "StandardDeviation": 0.1968615266952863, "ConfidenceInterval": { "N": 12, - "Mean": 12.739505464831987, - "StandardError": 0.02832331266158288, + "Mean": 13.541852640608946, + "StandardError": 0.05682902771530213, "Level": 12, - "Margin": 0.1256699530389926, - "Lower": 12.613835511792995, - "Upper": 12.86517541787098 + "Margin": 0.2521492217229404, + "Lower": 13.289703418886006, + "Upper": 13.794001862331886 } }, "allocated_bytes": 0 diff --git a/docs/images/performance/serialize-collections.svg b/docs/images/performance/serialize-collections.svg index e835f8e7..a10ebf62 100644 --- a/docs/images/performance/serialize-collections.svg +++ b/docs/images/performance/serialize-collections.svg @@ -24,77 +24,77 @@ int[]: 256 elements STJ reflection - -1.00x | 798.61 ns | 0 B + +1.00x | 793.01 ns | 0 B STJ source-gen metadata - - -1.00x | 800.92 ns | 0 B + + +1.00x | 790.48 ns | 0 B STJ source-gen fast path - - -1.34x | 1.07 us | 0 B + + +1.34x | 1.06 us | 0 B PolyType reflection - - -0.99x | 794.36 ns | 0 B + + +1.00x | 789.91 ns | 0 B PolyType source-gen - - -1.00x | 797.91 ns | 0 B + + +1.00x | 789.88 ns | 0 B PolyType fast path - - -0.90x | 720.52 ns | 0 B + + +0.91x | 718.01 ns | 0 B List<int>: 256 elements STJ reflection - -1.00x | 869.74 ns | 0 B + +1.00x | 864.55 ns | 0 B STJ source-gen metadata - - -1.02x | 886.75 ns | 0 B + + +1.00x | 863.85 ns | 0 B STJ source-gen fast path - - -1.15x | 1.00 us | 0 B + + +1.14x | 986.50 ns | 0 B PolyType reflection - - -1.06x | 924.38 ns | 0 B + + +1.06x | 915.74 ns | 0 B PolyType source-gen - - -1.32x | 1.15 us | 0 B + + +1.08x | 937.34 ns | 0 B PolyType fast path - - -0.90x | 784.10 ns | 0 B + + +0.90x | 778.23 ns | 0 B Dictionary<string, int>: 64 entries STJ reflection - -1.00x | 709.22 ns | 0 B + +1.00x | 657.49 ns | 0 B STJ source-gen metadata - - -0.99x | 702.93 ns | 0 B + + +0.99x | 651.99 ns | 0 B STJ source-gen fast path - - -0.88x | 626.69 ns | 0 B + + +0.95x | 622.66 ns | 0 B PolyType reflection - - -1.04x | 737.85 ns | 0 B + + +1.00x | 657.11 ns | 0 B PolyType source-gen - - -0.95x | 671.31 ns | 0 B + + +0.97x | 635.59 ns | 0 B PolyType fast path - - -0.88x | 622.27 ns | 0 B + + +0.91x | 601.59 ns | 0 B diff --git a/docs/images/performance/serialize-megabyte.svg b/docs/images/performance/serialize-megabyte.svg index 3c1dacc4..ecaad031 100644 --- a/docs/images/performance/serialize-megabyte.svg +++ b/docs/images/performance/serialize-megabyte.svg @@ -23,51 +23,51 @@ STJ reflection -1.00x | 3.12 ms | 912 B +1.00x | 3.10 ms | 912 B STJ source-gen metadata - - -0.97x | 3.03 ms | 912 B + + +0.99x | 3.06 ms | 912 B STJ source-gen fast path - - -0.48x | 1.51 ms | 0 B + + +0.51x | 1.59 ms | 0 B PolyType reflection - - -0.55x | 1.71 ms | 0 B + + +0.58x | 1.79 ms | 0 B PolyType source-gen - - -0.55x | 1.72 ms | 0 B + + +0.58x | 1.80 ms | 0 B PolyType fast path - - + + 0.51x | 1.59 ms | 0 B Large POCO array: 4,096 records, 2.64 MiB JSON STJ reflection - -1.00x | 2.54 ms | 312 B + +1.00x | 2.52 ms | 312 B STJ source-gen metadata - - -0.99x | 2.51 ms | 312 B + + +0.98x | 2.48 ms | 312 B STJ source-gen fast path - - -0.80x | 2.04 ms | 0 B + + +0.80x | 2.01 ms | 0 B PolyType reflection - - -0.91x | 2.32 ms | 0 B + + +0.89x | 2.24 ms | 0 B PolyType source-gen - - -0.88x | 2.24 ms | 0 B + + +0.86x | 2.18 ms | 0 B PolyType fast path - - -0.78x | 1.98 ms | 0 B + + +0.78x | 1.97 ms | 0 B diff --git a/docs/images/performance/serialize-pocos.svg b/docs/images/performance/serialize-pocos.svg index 4f3a79e7..263be9d2 100644 --- a/docs/images/performance/serialize-pocos.svg +++ b/docs/images/performance/serialize-pocos.svg @@ -22,52 +22,52 @@ Small POCO: 4 properties, parameterized constructor STJ reflection - -1.00x | 152.37 ns | 312 B + +1.00x | 146.72 ns | 312 B STJ source-gen metadata - - -0.92x | 139.96 ns | 312 B + + +0.94x | 138.64 ns | 312 B STJ source-gen fast path - - -0.44x | 67.79 ns | 0 B + + +0.45x | 66.30 ns | 0 B PolyType reflection - - -0.60x | 92.12 ns | 0 B + + +0.59x | 87.24 ns | 0 B PolyType source-gen - - -0.60x | 90.98 ns | 0 B + + +0.61x | 89.46 ns | 0 B PolyType fast path - - -0.43x | 66.16 ns | 0 B + + +0.45x | 66.70 ns | 0 B Large POCO: 24 properties, nested objects and collections STJ reflection - -1.00x | 627.84 ns | 312 B + +1.00x | 620.32 ns | 312 B STJ source-gen metadata - - -1.00x | 625.69 ns | 312 B + + +0.99x | 616.65 ns | 312 B STJ source-gen fast path - - -0.80x | 499.45 ns | 0 B + + +0.80x | 495.06 ns | 0 B PolyType reflection - - -0.89x | 559.91 ns | 0 B + + +0.90x | 555.28 ns | 0 B PolyType source-gen - - -0.87x | 548.10 ns | 0 B + + +0.89x | 549.02 ns | 0 B PolyType fast path - - -0.77x | 486.32 ns | 0 B + + +0.77x | 480.23 ns | 0 B diff --git a/docs/images/performance/serialize-primitives.svg b/docs/images/performance/serialize-primitives.svg index 79f55986..54ff4dc4 100644 --- a/docs/images/performance/serialize-primitives.svg +++ b/docs/images/performance/serialize-primitives.svg @@ -8,66 +8,70 @@ Ratio | Mean | Allocated / operation 0x - -0.25x - -0.5x - -0.75x - -1x + +0.25x + +0.5x + +0.75x + +1x + +1.25x + +1.5x -1.25x - +1.75x + int: 42 STJ reflection - - -1.00x | 13.63 ns | 0 B + + +1.00x | 13.64 ns | 0 B STJ source-gen metadata - - -1.00x | 13.70 ns | 0 B + + +1.41x | 19.29 ns | 0 B STJ source-gen fast path - - -1.00x | 13.69 ns | 0 B + + +1.00x | 13.60 ns | 0 B PolyType reflection - - -0.61x | 8.27 ns | 0 B + + +0.60x | 8.23 ns | 0 B PolyType source-gen - - -0.61x | 8.30 ns | 0 B + + +0.60x | 8.25 ns | 0 B PolyType fast path - - -0.62x | 8.46 ns | 0 B + + +0.62x | 8.44 ns | 0 B string: Hello, PolyType! STJ reflection - - -1.00x | 17.08 ns | 0 B + + +1.00x | 16.91 ns | 0 B STJ source-gen metadata - - -1.00x | 17.16 ns | 0 B + + +1.01x | 17.00 ns | 0 B STJ source-gen fast path - - -1.00x | 17.04 ns | 0 B + + +1.00x | 16.92 ns | 0 B PolyType reflection - - -0.70x | 11.93 ns | 0 B + + +0.70x | 11.78 ns | 0 B PolyType source-gen - - -0.68x | 11.62 ns | 0 B + + +0.71x | 12.07 ns | 0 B PolyType fast path - - -0.75x | 12.74 ns | 0 B + + +0.80x | 13.54 ns | 0 B diff --git a/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs b/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs index b77e681e..75ab24c5 100644 --- a/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs +++ b/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs @@ -1,5 +1,6 @@ using PolyType.FastPathJson.SourceGenerator.Model; using PolyType.Roslyn; +using System.Text; namespace PolyType.FastPathJson.SourceGenerator; @@ -197,6 +198,19 @@ private static void WriteObjectConverter(SourceWriter writer, ObjectConverterMod writer.WriteLine(); } + // Every UTF-16 code unit can be represented by a six-byte \uXXXX escape. + bool needsRentedPropertyNameBuffer = model.Slots.Any(slot => slot.Name.Length > 256 / 6); + writer.WriteLine("global::System.Span propertyNameBuffer = stackalloc byte[256];"); + if (needsRentedPropertyNameBuffer) + { + writer.WriteLine(""" + byte[]? rentedPropertyNameBuffer = null; + try + { + """); + writer.Indentation++; + } + writer.WriteLine($$""" while (true) { @@ -205,28 +219,55 @@ private static void WriteObjectConverter(SourceWriter writer, ObjectConverterMod { break; } - + """); + writer.WriteLine(); + writer.WriteLine($$""" if (reader.TokenType is {{Token}}Comment) { {{Shared}}.EnsureToken(ref reader, {{Token}}PropertyName); } + """); + writer.WriteLine(); + if (needsRentedPropertyNameBuffer) + { + writer.WriteLine($$""" + global::System.ReadOnlySpan name = {{Shared}}.GetUtf8PropertyName(in reader, propertyNameBuffer, ref rentedPropertyNameBuffer); + """); + } + else + { + writer.WriteLine($$""" + if (!{{Shared}}.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + {{Shared}}.EnsureRead(ref reader); + reader.Skip(); + continue; + } + """); + } - string name = reader.GetString()!; - {{Shared}}.EnsureRead(ref reader); - + writer.WriteLine($" {Shared}.EnsureRead(ref reader);"); + writer.WriteLine(); + writer.WriteLine(""" switch (name) { """); writer.Indentation += 2; + string?[] namePatterns = GetPropertyNamePatterns(model); for (int i = 0; i < model.Slots.Length; i++) { + if (namePatterns[i] is not { } pattern) + { + continue; + } + if (i > 0) { writer.WriteLine(); } ReadSlot slot = model.Slots[i]; - writer.WriteLine($"case {Literal(slot.Name)}:"); + writer.WriteLine($"case {pattern} when global::System.MemoryExtensions.SequenceEqual(name, {Literal(slot.Name)}u8):"); writer.Indentation++; writer.WriteLine($"arg{i} = {FormatRead(slot.Type)};"); if (slot.DisallowNull) @@ -264,6 +305,20 @@ private static void WriteObjectConverter(SourceWriter writer, ObjectConverterMod } } """); + if (needsRentedPropertyNameBuffer) + { + writer.Indentation--; + writer.WriteLine(""" + } + finally + { + if (rentedPropertyNameBuffer is not null) + { + global::System.Buffers.ArrayPool.Shared.Return(rentedPropertyNameBuffer); + } + } + """); + } if (requiredSlots.Length > 0) { writer.WriteLine(); @@ -327,6 +382,40 @@ string FormatPresenceCheck(int slot) writer.WriteLine('}'); } + private static string?[] GetPropertyNamePatterns(ObjectConverterModel model) + { + string?[] patterns = new string?[model.Slots.Length]; + // Names with unpaired surrogates cannot match valid JSON text or appear in UTF-8 literals. + var names = model.Slots.Select((slot, index) => (Bytes: Encoding.UTF8.GetBytes(slot.Name), Index: index)) + .Where(name => Encoding.UTF8.GetString(name.Bytes) == model.Slots[name.Index].Name); + foreach (var group in names.GroupBy(name => name.Bytes.Length)) + { + int length = group.Key; + if (length == 0 || group.Count() == 1) + { + foreach (var name in group) + { + patterns[name.Index] = $"{{ Length: {length} }}"; + } + + continue; + } + + // Let Roslyn branch on length and a discriminating byte; compare the rest with vectorized UTF-8 equality. + int position = Enumerable.Range(0, length) + .OrderByDescending(i => group.Select(name => name.Bytes[i]).Distinct().Count()) + .First(); + foreach (var name in group) + { + string[] elements = Enumerable.Repeat("_", length).ToArray(); + elements[position] = $"(byte){Literal((char)name.Bytes[position])}"; + patterns[name.Index] = "[" + string.Join(", ", elements) + "]"; + } + } + + return patterns; + } + private static void WriteMissingRequiredParameterHelper(SourceWriter writer, ObjectConverterModel model, int[] requiredSlots, bool useBitArray) { string parameter = useBitArray ? "global::System.Collections.BitArray seen" : "ulong missing"; diff --git a/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.cs b/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.cs index 2ec6bf2b..707e5044 100644 --- a/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.cs +++ b/src/fast-path-json/PolyType.FastPathJson.SourceGenerator/SourceFormatter/SourceFormatter.cs @@ -194,6 +194,8 @@ private static void WriteNullGuard(SourceWriter writer, TypeRef type, bool readi private static string Literal(string text) => SymbolDisplay.FormatLiteral(text, quote: true); + private static string Literal(char value) => SymbolDisplay.FormatLiteral(value, quote: true); + private static string GetConverterIdentifier(TypeRef type) => type.Converter.Substring(ScalarTypes.GeneratedPrefix.Length); private static string FormatWrite(TypeRef type, string value) => diff --git a/src/fast-path-json/PolyType.FastPathJson/Converters/ScalarHelpers.cs b/src/fast-path-json/PolyType.FastPathJson/Converters/ScalarHelpers.cs index 9e1b76d5..bd328ee0 100644 --- a/src/fast-path-json/PolyType.FastPathJson/Converters/ScalarHelpers.cs +++ b/src/fast-path-json/PolyType.FastPathJson/Converters/ScalarHelpers.cs @@ -15,7 +15,7 @@ internal static class ScalarHelpers public static int GetValueLength(scoped in Utf8JsonReader reader) => checked((int)(reader.HasValueSequence ? reader.ValueSequence.Length : reader.ValueSpan.Length)); - public static ReadOnlySpan GetUtf8Value(scoped in Utf8JsonReader reader, Span buffer, ref byte[]? rented) + public static ReadOnlySpan GetUtf8Value(scoped in Utf8JsonReader reader, Span buffer, scoped ref byte[]? rented) { if (!reader.HasValueSequence && !reader.ValueIsEscaped) { @@ -23,7 +23,18 @@ public static ReadOnlySpan GetUtf8Value(scoped in Utf8JsonReader reader, S } int length = GetValueLength(in reader); - Span destination = length <= buffer.Length ? buffer : (rented = ArrayPool.Shared.Rent(length)); + if (length > buffer.Length && (rented is null || rented.Length < length)) + { + byte[] replacement = ArrayPool.Shared.Rent(length); + if (rented is not null) + { + ArrayPool.Shared.Return(rented); + } + + rented = replacement; + } + + Span destination = length <= buffer.Length ? buffer : rented; if (reader.TokenType is JsonTokenType.Number) { reader.ValueSequence.CopyTo(destination); diff --git a/src/fast-path-json/PolyType.FastPathJson/SerializationHelpers.cs b/src/fast-path-json/PolyType.FastPathJson/SerializationHelpers.cs index a8522381..4a254132 100644 --- a/src/fast-path-json/PolyType.FastPathJson/SerializationHelpers.cs +++ b/src/fast-path-json/PolyType.FastPathJson/SerializationHelpers.cs @@ -1,3 +1,4 @@ +using PolyType.FastPathJson.Converters; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; @@ -64,6 +65,73 @@ public static bool UsesDefaultEncoder(Utf8JsonWriter writer) return encoder is null || ReferenceEquals(encoder, JavaScriptEncoder.Default); } + /// Gets the unescaped UTF-8 property name, borrowing contiguous unescaped input when possible. + /// The reader positioned on a property name. + /// Scratch space for escaped or segmented names. + /// A reusable pooled buffer, returned by the caller to . + /// The property name, valid until the scratch space or input is reused. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ReadOnlySpan GetUtf8PropertyName(scoped in Utf8JsonReader reader, Span buffer, scoped ref byte[]? rented) + { + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + ReadOnlySpan name = reader.ValueSpan; + if (!System.Text.Unicode.Utf8.IsValid(name)) + { + ThrowInvalidUtf8PropertyName(); + } + + return name; + } + + return ScalarHelpers.GetUtf8Value(in reader, buffer, ref rented); + + [DoesNotReturn] + [MethodImpl(MethodImplOptions.NoInlining)] + static void ThrowInvalidUtf8PropertyName() => + throw new InvalidOperationException("Cannot transcode invalid UTF-8 JSON text to UTF-16 string."); + } + + /// Gets a UTF-8 property name without retaining a pooled buffer. + /// The reader positioned on a property name. + /// Scratch space large enough for every matching name, including its longest escaped representation. + /// The unescaped property name when successful. + /// False for escaped or segmented names whose raw length exceeds the scratch space; otherwise true. + /// Oversized names are still validated, but cannot match the caller's known names. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryGetUtf8PropertyName(scoped in Utf8JsonReader reader, Span buffer, out ReadOnlySpan name) + { + if ((!reader.HasValueSequence && !reader.ValueIsEscaped) || ScalarHelpers.GetValueLength(in reader) <= buffer.Length) + { + byte[]? rented = null; + name = GetUtf8PropertyName(in reader, buffer, ref rented); + + return true; + } + + ValidateOversizedPropertyName(in reader); + name = default; + + return false; + + [MethodImpl(MethodImplOptions.NoInlining)] + static void ValidateOversizedPropertyName(scoped in Utf8JsonReader reader) + { + byte[]? rented = null; + try + { + _ = ScalarHelpers.GetUtf8Value(in reader, Span.Empty, ref rented); + } + finally + { + if (rented is not null) + { + System.Buffers.ArrayPool.Shared.Return(rented); + } + } + } + } + /// Advances the reader, throwing if the JSON value is incomplete. /// The reader to advance. [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/fast-path-json/README.md b/src/fast-path-json/README.md index d61eae26..e551c548 100644 --- a/src/fast-path-json/README.md +++ b/src/fast-path-json/README.md @@ -13,6 +13,15 @@ The two projects have separate roles: The projects have no dependency on `PolyType.dll` or the built-in `PolyType.SourceGenerator`, and are not packaged. +Object readers match unescaped UTF-8 property names without allocating strings. Contiguous, +unescaped names borrow the reader's input; escaped or segmented names use `Utf8JsonReader.CopyString` +with reusable stack or pooled scratch space. Generated switches select by byte length and a +discriminating byte, then use `SequenceEqual` against UTF-8 literals so the JIT can compare +multiple bytes at once instead of checking every element of a full byte-list pattern. +When every known name fits the 256-byte stack buffer even with `\uXXXX` escaping, readers +omit pooled-buffer state and its `try`/`finally`. Oversized unknown names still undergo +validation in a separate slow path before their values are skipped. + ## Usage Reference `PolyType.FastPathJson` normally and reference `PolyType.FastPathJson.SourceGenerator` with `OutputItemType="Analyzer"` and `ReferenceOutputAssembly="false"`. diff --git a/tests/PolyType.FastPathJson.Tests/PropertyNameBufferTests.cs b/tests/PolyType.FastPathJson.Tests/PropertyNameBufferTests.cs new file mode 100644 index 00000000..528847f9 --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/PropertyNameBufferTests.cs @@ -0,0 +1,103 @@ +using PolyType.Tests; +using System.Buffers; +using System.Runtime.Loader; +using System.Text; +using System.Text.Json; +using Xunit; + +namespace PolyType.FastPathJson.Tests; + +public static class PropertyNameBufferTests +{ + [Theory] + [InlineData(42, false)] + [InlineData(42, true)] + [InlineData(43, false)] + [InlineData(43, true)] + public static void MaximallyEscapedNamesRoundtripAtTheStackBufferBoundary(int length, bool segmented) + { + string source = $$""" + [GenerateJson] + public partial class Payload + { + [System.Text.Json.Serialization.JsonPropertyName("{{new string('\u00E9', length)}}")] + public int Value { get; set; } + } + + public static class Consumer + { + public static int Read(ref System.Text.Json.Utf8JsonReader reader) => + FastPathJsonSerializer.Deserialize(ref reader)!.Value; + } + """; + var result = CompilationHelpers.Run(source); + using MemoryStream assemblyStream = new(); + var emitted = result.Compilation.Emit(assemblyStream, cancellationToken: TestContext.Current.CancellationToken); + Assert.True(emitted.Success, string.Join(Environment.NewLine, emitted.Diagnostics)); + assemblyStream.Position = 0; + AssemblyLoadContext context = new("PropertyNameBufferBoundary", isCollectible: true); + try + { + var assembly = context.LoadFromStream(assemblyStream); + GeneratedReader deserialize = assembly.GetType("Consumer")!.GetMethod("Read")!.CreateDelegate(); + string name = string.Concat(Enumerable.Repeat(@"\u00E9", length)); + string oversizedUnknownName = string.Concat(Enumerable.Repeat(@"\u0061", 300)); + string json = $$$"""{"{{{oversizedUnknownName}}}":{},"{{{name}}}":42,"":99,"{{{oversizedUnknownName}}}":[]}"""; + Utf8JsonReader reader = new(CreateSequence(Encoding.UTF8.GetBytes(json), segmented)); + Assert.Equal(42, deserialize(ref reader)); + Assert.Equal(JsonTokenType.EndObject, reader.TokenType); + Assert.False(reader.Read()); + } + finally + { + context.Unload(); + } + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public static void OversizedUnknownNamesStillRejectInvalidUnicode(bool segmented) + { + string name = new string('a', 300) + @"\uD800"; + string json = $$"""{"{{name}}":0,"Value":42}"""; + ReadOnlySequence sequence = CreateSequence(Encoding.UTF8.GetBytes(json), segmented); + Assert.Throws(() => + { + Utf8JsonReader reader = new(sequence); + FastPathJsonSerializer.Deserialize(ref reader); + }); + } + + private delegate int GeneratedReader(ref Utf8JsonReader reader); + + private static ReadOnlySequence CreateSequence(byte[] bytes, bool segmented) + { + if (!segmented) + { + return new(bytes); + } + + Segment first = new(bytes.AsMemory(0, 1)); + Segment last = first; + for (int i = 1; i < bytes.Length; i++) + { + last = last.Append(bytes.AsMemory(i, 1)); + } + + return new(first, 0, last, last.Memory.Length); + } + + private sealed class Segment : ReadOnlySequenceSegment + { + public Segment(ReadOnlyMemory memory) => Memory = memory; + + public Segment Append(ReadOnlyMemory memory) + { + Segment next = new(memory) { RunningIndex = RunningIndex + Memory.Length }; + Next = next; + + return next; + } + } +} diff --git a/tests/PolyType.FastPathJson.Tests/PropertyNameReadingTests.cs b/tests/PolyType.FastPathJson.Tests/PropertyNameReadingTests.cs new file mode 100644 index 00000000..3b6c058a --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/PropertyNameReadingTests.cs @@ -0,0 +1,211 @@ +using Microsoft.CodeAnalysis; +using PolyType.Tests; +using System.Buffers; +using System.Runtime.Loader; +using System.Text; +using System.Text.Encodings.Web; +using System.Text.Json; +using Xunit; + +namespace PolyType.FastPathJson.Tests; + +public static class PropertyNameReadingTests +{ + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public static void PropertyNamesPreserveEscapingAndExactMatching(bool escaped, bool segmented) + { + Dictionary properties = new() + { + ["inherited"] = 1, + ["ascii"] = "plain", + [""] = "html", + ["quote\"\\\n\0"] = "escaped", + ["\u00E9\uD83E\uDD2F"] = "unicode", + [""] = "empty", + ["Ascii"] = "ignored", + ["ascij"] = new[] { 1, 2 }, + [""] = new { Nested = true }, + ["\u00E9\uD83E\uDD2E"] = "ignored", + [new string('a', 300)] = new { Nested = new[] { 1, 2 } }, + [new string('\u00E9', 600)] = "ignored", + [new string('b', 400)] = false, + }; + JsonSerializerOptions options = new() + { + Encoder = escaped ? JavaScriptEncoder.Default : JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + }; + byte[] json = JsonSerializer.SerializeToUtf8Bytes(properties, options); + CachedNamePayload? value = Read(CreateSequence(json, segmented)); + + Assert.NotNull(value); + Assert.Equal(1, value.Inherited); + Assert.Equal("plain", value.Plain); + Assert.Equal("html", value.Html); + Assert.Equal("escaped", value.Escaped); + Assert.Equal("unicode", value.Unicode); + Assert.Equal("empty", value.Empty); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public static void SameLengthNamesAndDuplicatesMatchExactly(bool escaped, bool segmented) + { + string json = """{"Item0":0,"Item9":9,"Item8":8,"Item7":7,"Item6":6,"Item5":5,"Item4":4,"Item3":3,"Item2":2,"Item1":1,"Item1":42,"ItemX":99,"Item10":10}"""; + if (escaped) + { + json = json.Replace("Item", @"\u0049\u0074\u0065\u006D", StringComparison.Ordinal); + } + + var value = Read<(int, int, int, int, int, int, int, int, int), TestCasesWitness>( + CreateSequence(Encoding.UTF8.GetBytes(json), segmented)); + Assert.Equal((42, 2, 3, 4, 5, 6, 7, 8, 9), value); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public static void PropertyNamesDoNotAllocateStrings(bool segmented) + { + ReadOnlySequence baseline = CreateSequence("""{"Value":0,"Value":42}"""u8.ToArray(), segmented); + string longName = new('a', 600); + string json = $$$"""{"{{{longName}}}":[],"Value":0,"\u0056alue":42,"{{{longName}}}":{}}"""; + ReadOnlySequence repeatedNames = CreateSequence(Encoding.UTF8.GetBytes(json), segmented); + Measure(baseline); + Measure(repeatedNames); + + var expected = Measure(baseline); + var actual = Measure(repeatedNames); + Assert.Equal(42_000, expected.Sum); + Assert.Equal(expected.Sum, actual.Sum); + // Allow pool/profiler bookkeeping, but less than one additional string allocation per read. + Assert.InRange(actual.AllocatedBytes - expected.AllocatedBytes, -16_000L, 16_000L); + + static (long AllocatedBytes, int Sum) Measure(ReadOnlySequence json) + { + long before = GC.GetAllocatedBytesForCurrentThread(); + int sum = 0; + for (int i = 0; i < 1000; i++) + { + Utf8JsonReader reader = new(json); + sum += FastPathJsonSerializer.Deserialize(ref reader)!.Value; + } + + return (GC.GetAllocatedBytesForCurrentThread() - before, sum); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public static void InvalidPropertyNameTextIsRejected(bool escaped, bool segmented) + { + byte[] json = escaped + ? """{"\uD800":0}"""u8.ToArray() + : [(byte)'{', (byte)'"', 0xFF, (byte)'"', (byte)':', (byte)'0', (byte)'}']; + ReadOnlySequence sequence = CreateSequence(json, segmented); + Assert.Throws(() => Read(sequence)); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public static void LongNamesAndUnpairedSurrogateMetadataPreserveBehavior(bool escaped, bool segmented) + { + string longName = new('a', 600); + string source = $$""" + [GenerateJson] + public partial class Payload + { + [System.Text.Json.Serialization.JsonPropertyName("{{longName}}")] + public int Value { get; set; } + + [System.Text.Json.Serialization.JsonPropertyName("\uD800")] + public int Unreachable { get; set; } = -1; + } + + public static class Consumer + { + public static int Read(ref System.Text.Json.Utf8JsonReader reader) + { + Payload value = FastPathJsonSerializer.Deserialize(ref reader)!; + return value.Value + value.Unreachable; + } + } + """; + var result = CompilationHelpers.Run(source); + using MemoryStream assemblyStream = new(); + var emitted = result.Compilation.Emit(assemblyStream, cancellationToken: TestContext.Current.CancellationToken); + Assert.True(emitted.Success, string.Join(Environment.NewLine, emitted.Diagnostics)); + assemblyStream.Position = 0; + AssemblyLoadContext context = new("PropertyNameReader", isCollectible: true); + try + { + var assembly = context.LoadFromStream(assemblyStream); + GeneratedReader deserialize = assembly.GetType("Consumer")!.GetMethod("Read")!.CreateDelegate(); + string jsonName = escaped ? string.Concat(Enumerable.Repeat(@"\u0061", 600)) : longName; + string json = $$"""{"{{jsonName}}":42,"\uFFFD":99}"""; + Utf8JsonReader reader = new(CreateSequence(Encoding.UTF8.GetBytes(json), segmented)); + Assert.Equal(41, deserialize(ref reader)); + Assert.Equal(JsonTokenType.EndObject, reader.TokenType); + Assert.False(reader.Read()); + } + finally + { + context.Unload(); + } + } + + private delegate int GeneratedReader(ref Utf8JsonReader reader); + + private static T? Read(ReadOnlySequence json) + where TWitness : IJsonSerializable + { + Utf8JsonReader reader = new(json); + T? value = FastPathJsonSerializer.Deserialize(ref reader); + Assert.Equal(JsonTokenType.EndObject, reader.TokenType); + Assert.False(reader.Read()); + + return value; + } + + private static ReadOnlySequence CreateSequence(byte[] bytes, bool segmented) + { + if (!segmented) + { + return new(bytes); + } + + Segment first = new(bytes.AsMemory(0, 1)); + Segment last = first; + for (int i = 1; i < bytes.Length; i++) + { + last = last.Append(bytes.AsMemory(i, 1)); + } + + return new(first, 0, last, last.Memory.Length); + } + + private sealed class Segment : ReadOnlySequenceSegment + { + public Segment(ReadOnlyMemory memory) => Memory = memory; + + public Segment Append(ReadOnlyMemory memory) + { + Segment next = new(memory) { RunningIndex = RunningIndex + Memory.Length }; + Next = next; + + return next; + } + } +} diff --git a/tests/PolyType.FastPathJson.Tests/SnapshotTests.cs b/tests/PolyType.FastPathJson.Tests/SnapshotTests.cs index 160eb2e9..562a5b36 100644 --- a/tests/PolyType.FastPathJson.Tests/SnapshotTests.cs +++ b/tests/PolyType.FastPathJson.Tests/SnapshotTests.cs @@ -40,6 +40,32 @@ namespace TestNamespace; [GenerateJson] public partial record Person(int Id, string Name, bool IsActive); """]; + yield return ["EscapedPropertyNameDiscriminators", """ + using System.Text.Json.Serialization; + namespace TestNamespace; + + [GenerateJson] + public partial record Payload( + [property: JsonPropertyName("'a")] int Quote, + [property: JsonPropertyName("\\a")] int Backslash, + [property: JsonPropertyName("\na")] int Newline, + [property: JsonPropertyName("\0a")] int Null, + [property: JsonPropertyName("\u00E9")] int Unicode); + """]; + foreach (int nameLength in new[] { 42, 43 }) + { + yield return [$"PropertyNameBuffer{nameLength}", $$""" + namespace TestNamespace; + + [GenerateJson] + public partial class Payload + { + [System.Text.Json.Serialization.JsonPropertyName("{{new string('\u00E9', nameLength)}}")] + public int Value { get; set; } + } + """]; + } + yield return ["JsonMetadata", """ using System; using System.Text.Json.Serialization; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt index 3afc5102..278b0276 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class DictionaryHolder : global::PolyType.FastPathJson.IJsonSeria global::System.Collections.Generic.SortedList? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class DictionaryHolder : global::PolyType.FastPathJson.IJsonSeria { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Lookup": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Lookup"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.DictionaryConverter>(ref reader); seen |= 1UL << 0; break; - case "Ordered": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Ordered"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Generated.GeneratedJsonConverters.SortedList_Int32_StringConverter>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EnumType/FastPathJson.StatusHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EnumType/FastPathJson.StatusHolder.g.cs.txt index 9c3bf797..695e0e13 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EnumType/FastPathJson.StatusHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EnumType/FastPathJson.StatusHolder.g.cs.txt @@ -49,6 +49,7 @@ public partial record StatusHolder : global::PolyType.FastPathJson.IJsonSerializ global::TestNamespace.Status arg0 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -56,18 +57,23 @@ public partial record StatusHolder : global::PolyType.FastPathJson.IJsonSerializ { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..705324e4 --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,198 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("'a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property1 = global::System.Text.Json.JsonEncodedText.Encode("\\a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property2 = global::System.Text.Json.JsonEncodedText.Encode("\na"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property3 = global::System.Text.Json.JsonEncodedText.Encode("\0a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property4 = global::System.Text.Json.JsonEncodedText.Encode("é"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Quote; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("'a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + + var property1 = value.Backslash; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property1, property1!); + } + else + { + writer.WritePropertyName("\\a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property1!); + } + + var property2 = value.Newline; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property2, property2!); + } + else + { + writer.WritePropertyName("\na"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property2!); + } + + var property3 = value.Null; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property3, property3!); + } + else + { + writer.WritePropertyName("\0a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property3!); + } + + var property4 = value.Unicode; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property4, property4!); + } + else + { + writer.WritePropertyName("é"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property4!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + int arg1 = default; + int arg2 = default; + int arg3 = default; + int arg4 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case [(byte)'\'', _] when global::System.MemoryExtensions.SequenceEqual(name, "'a"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + case [(byte)'\\', _] when global::System.MemoryExtensions.SequenceEqual(name, "\\a"u8): + arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 1; + break; + + case [(byte)'\n', _] when global::System.MemoryExtensions.SequenceEqual(name, "\na"u8): + arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 2; + break; + + case [(byte)'\0', _] when global::System.MemoryExtensions.SequenceEqual(name, "\0a"u8): + arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 3; + break; + + case [(byte)'Ã', _] when global::System.MemoryExtensions.SequenceEqual(name, "é"u8): + arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 4; + break; + + default: + reader.Skip(); + break; + } + } + + if ((seen & 0x1FUL) != 0x1FUL) + { + ThrowMissingRequiredParameters(0x1FUL & ~seen); + } + + var result = new global::TestNamespace.Payload(arg0!, arg1!, arg2!, arg3!, arg4!); + + return result; + + [global::System.Diagnostics.CodeAnalysis.DoesNotReturn] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] + static void ThrowMissingRequiredParameters(ulong missing) + { + var names = new global::System.Collections.Generic.List(); + + while (missing != 0) + { + int index = global::System.Numerics.BitOperations.TrailingZeroCount(missing); + string name = index switch + { + 0 => "'a", + 1 => "\\a", + 2 => "\na", + 3 => "\0a", + 4 => "é", + _ => throw new global::System.InvalidOperationException("Invalid required constructor parameter index."), + }; + + names.Add(name); + missing &= missing - 1; + } + + global::PolyType.FastPathJson.SerializationHelpers.ThrowMissingRequiredParameters(names); + } + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt index 026dcb2f..191580ef 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt @@ -70,6 +70,7 @@ internal static partial class GeneratedJsonConverters int arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -77,18 +78,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg0 is null) { @@ -98,7 +104,7 @@ internal static partial class GeneratedJsonConverters seen |= 1UL << 0; break; - case "Age": + case { Length: 3 } when global::System.MemoryExtensions.SequenceEqual(name, "Age"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt index 829b47ff..bbced96d 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt @@ -54,6 +54,7 @@ internal static partial class GeneratedJsonConverters double[]? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -61,23 +62,28 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FusedScalarProperties/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FusedScalarProperties/FastPathJson.Payload.g.cs.txt index ca46cbb8..8d9353e8 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FusedScalarProperties/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/FusedScalarProperties/FastPathJson.Payload.g.cs.txt @@ -203,6 +203,7 @@ public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable< int? arg11 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -210,73 +211,78 @@ public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable< { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Flag": + case [(byte)'F', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Flag"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Number": + case [(byte)'N', _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Number"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Ratio": + case [(byte)'R', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Ratio"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Amount": + case [(byte)'A', _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Amount"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "Text": + case [(byte)'T', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Text"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "Date": + case [(byte)'D', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Date"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "Timestamp": + case [(byte)'T', _, _, _, _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Timestamp"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "Link": + case [(byte)'L', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Link"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; - case "Character": + case [(byte)'C', _, _, _, _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Character"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 9; break; - case "Bytes": + case [(byte)'B', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Bytes"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 10; break; - case "Optional": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Optional"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 11; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/JsonMetadata/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/JsonMetadata/FastPathJson.Person.g.cs.txt index 278030e2..b1efa54e 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/JsonMetadata/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/JsonMetadata/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -115,7 +121,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/KeywordMembers/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/KeywordMembers/FastPathJson.Payload.g.cs.txt index c2d72791..5687ba59 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/KeywordMembers/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/KeywordMembers/FastPathJson.Payload.g.cs.txt @@ -91,6 +91,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -98,33 +99,38 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Ordered": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Ordered"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "class": + case [(byte)'c', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "class"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "event": + case [(byte)'e', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "event"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "required": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "required"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/ListCollection/FastPathJson.ListHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/ListCollection/FastPathJson.ListHolder.g.cs.txt index 053bc6f3..e9c7a188 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/ListCollection/FastPathJson.ListHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/ListCollection/FastPathJson.ListHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class ListHolder : global::PolyType.FastPathJson.IJsonSerializabl int[]? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class ListHolder : global::PolyType.FastPathJson.IJsonSerializabl { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Items": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Items"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.ListConverter>(ref reader); seen |= 1UL << 0; break; - case "Values": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Values"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt index a3b5af38..a564fde1 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt @@ -959,6 +959,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -966,343 +967,348 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "O0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "O0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[65] = true; break; - case "R0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R0"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[0] = true; break; - case "R1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R1"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[1] = true; break; - case "R2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R2"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[2] = true; break; - case "R3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R3"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[3] = true; break; - case "R4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R4"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[4] = true; break; - case "R5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R5"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[5] = true; break; - case "R6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R6"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[6] = true; break; - case "R7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R7"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[7] = true; break; - case "R8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R8"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[8] = true; break; - case "R9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R9"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[9] = true; break; - case "R10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R10"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[10] = true; break; - case "R11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R11"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[11] = true; break; - case "R12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R12"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[12] = true; break; - case "R13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R13"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[13] = true; break; - case "R14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R14"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[14] = true; break; - case "R15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R15"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[15] = true; break; - case "R16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R16"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[16] = true; break; - case "R17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R17"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[17] = true; break; - case "R18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R18"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[18] = true; break; - case "R19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R19"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[19] = true; break; - case "R20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R20"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[20] = true; break; - case "R21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R21"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[21] = true; break; - case "R22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R22"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[22] = true; break; - case "R23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R23"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[23] = true; break; - case "R24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R24"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[24] = true; break; - case "R25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R25"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[25] = true; break; - case "R26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R26"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[26] = true; break; - case "R27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R27"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[27] = true; break; - case "R28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R28"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[28] = true; break; - case "R29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R29"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[29] = true; break; - case "R30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R30"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[30] = true; break; - case "R31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R31"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[31] = true; break; - case "R32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R32"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[32] = true; break; - case "R33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R33"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[33] = true; break; - case "R34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R34"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[34] = true; break; - case "R35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R35"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[35] = true; break; - case "R36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R36"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[36] = true; break; - case "R37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R37"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[37] = true; break; - case "R38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R38"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[38] = true; break; - case "R39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R39"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[39] = true; break; - case "R40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R40"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[40] = true; break; - case "R41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R41"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[41] = true; break; - case "R42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R42"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[42] = true; break; - case "R43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R43"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[43] = true; break; - case "R44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R44"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[44] = true; break; - case "R45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R45"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[45] = true; break; - case "R46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R46"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[46] = true; break; - case "R47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R47"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[47] = true; break; - case "R48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R48"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[48] = true; break; - case "R49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R49"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[49] = true; break; - case "R50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R50"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[50] = true; break; - case "R51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R51"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[51] = true; break; - case "R52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R52"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[52] = true; break; - case "R53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R53"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[53] = true; break; - case "R54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R54"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[54] = true; break; - case "R55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R55"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[55] = true; break; - case "R56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R56"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[56] = true; break; - case "R57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R57"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[57] = true; break; - case "R58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R58"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[58] = true; break; - case "R59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R59"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[59] = true; break; - case "R60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R60"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[60] = true; break; - case "R61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R61"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[61] = true; break; - case "R62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R62"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[62] = true; break; - case "R63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R63"u8): arg64 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[63] = true; break; - case "R64": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R64"u8): arg65 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[64] = true; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/NullableValueType/FastPathJson.NullableHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/NullableValueType/FastPathJson.NullableHolder.g.cs.txt index 9e4dc595..0edcdb64 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/NullableValueType/FastPathJson.NullableHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/NullableValueType/FastPathJson.NullableHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class NullableHolder : global::PolyType.FastPathJson.IJsonSeriali global::System.DateTime? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class NullableHolder : global::PolyType.FastPathJson.IJsonSeriali { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Number": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Number"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; - case "Date": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Date"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..32beef8f --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,96 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("éééééééééééééééééééééééééééééééééééééééééé"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Value; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("éééééééééééééééééééééééééééééééééééééééééé"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case { Length: 84 } when global::System.MemoryExtensions.SequenceEqual(name, "éééééééééééééééééééééééééééééééééééééééééé"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + default: + reader.Skip(); + break; + } + } + + var result = new global::TestNamespace.Payload(); + + if ((seen & (1UL << 0)) != 0) + { + result.Value = arg0!; + } + + return result; + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..af90130c --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,102 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("ééééééééééééééééééééééééééééééééééééééééééé"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Value; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("ééééééééééééééééééééééééééééééééééééééééééé"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + byte[]? rentedPropertyNameBuffer = null; + try + { + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + global::System.ReadOnlySpan name = global::PolyType.FastPathJson.SerializationHelpers.GetUtf8PropertyName(in reader, propertyNameBuffer, ref rentedPropertyNameBuffer); + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case { Length: 86 } when global::System.MemoryExtensions.SequenceEqual(name, "ééééééééééééééééééééééééééééééééééééééééééé"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + default: + reader.Skip(); + break; + } + } + } + finally + { + if (rentedPropertyNameBuffer is not null) + { + global::System.Buffers.ArrayPool.Shared.Return(rentedPropertyNameBuffer); + } + } + + var result = new global::TestNamespace.Payload(); + + if ((seen & (1UL << 0)) != 0) + { + result.Value = arg0!; + } + + return result; + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RecursiveObject/FastPathJson.Node.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RecursiveObject/FastPathJson.Node.g.cs.txt index 3a8dcca2..70f9f83a 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RecursiveObject/FastPathJson.Node.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RecursiveObject/FastPathJson.Node.g.cs.txt @@ -77,6 +77,7 @@ public partial class Node : global::PolyType.FastPathJson.IJsonSerializable? arg2 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -84,28 +85,33 @@ public partial class Node : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Next": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Next"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Children": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Children"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.ListConverter>(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties64/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties64/FastPathJson.Payload.g.cs.txt index a8d47ef0..399751b9 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties64/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties64/FastPathJson.Payload.g.cs.txt @@ -931,6 +931,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -938,333 +939,338 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "P0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "P1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P1"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "P2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P2"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "P3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P3"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "P4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P4"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "P5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P5"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "P6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P6"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "P7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P7"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "P8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P8"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; - case "P9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P9"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 9; break; - case "P10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P10"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 10; break; - case "P11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P11"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 11; break; - case "P12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P12"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 12; break; - case "P13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P13"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 13; break; - case "P14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P14"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 14; break; - case "P15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P15"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 15; break; - case "P16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P16"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 16; break; - case "P17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P17"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 17; break; - case "P18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P18"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 18; break; - case "P19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P19"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 19; break; - case "P20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P20"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 20; break; - case "P21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P21"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 21; break; - case "P22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P22"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 22; break; - case "P23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P23"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 23; break; - case "P24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P24"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 24; break; - case "P25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P25"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 25; break; - case "P26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P26"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 26; break; - case "P27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P27"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 27; break; - case "P28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P28"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 28; break; - case "P29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P29"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 29; break; - case "P30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P30"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 30; break; - case "P31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P31"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 31; break; - case "P32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P32"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 32; break; - case "P33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P33"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 33; break; - case "P34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P34"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 34; break; - case "P35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P35"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 35; break; - case "P36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P36"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 36; break; - case "P37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P37"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 37; break; - case "P38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P38"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 38; break; - case "P39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P39"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 39; break; - case "P40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P40"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 40; break; - case "P41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P41"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 41; break; - case "P42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P42"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 42; break; - case "P43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P43"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 43; break; - case "P44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P44"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 44; break; - case "P45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P45"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 45; break; - case "P46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P46"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 46; break; - case "P47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P47"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 47; break; - case "P48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P48"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 48; break; - case "P49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P49"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 49; break; - case "P50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P50"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 50; break; - case "P51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P51"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 51; break; - case "P52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P52"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 52; break; - case "P53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P53"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 53; break; - case "P54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P54"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 54; break; - case "P55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P55"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 55; break; - case "P56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P56"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 56; break; - case "P57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P57"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 57; break; - case "P58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P58"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 58; break; - case "P59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P59"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 59; break; - case "P60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P60"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 60; break; - case "P61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P61"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 61; break; - case "P62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P62"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 62; break; - case "P63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P63"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 63; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties65/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties65/FastPathJson.Payload.g.cs.txt index a52ee568..c280deb6 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties65/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/RequiredProperties65/FastPathJson.Payload.g.cs.txt @@ -945,6 +945,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -952,338 +953,343 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "P0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[0] = true; break; - case "P1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P1"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[1] = true; break; - case "P2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P2"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[2] = true; break; - case "P3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P3"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[3] = true; break; - case "P4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P4"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[4] = true; break; - case "P5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P5"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[5] = true; break; - case "P6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P6"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[6] = true; break; - case "P7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P7"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[7] = true; break; - case "P8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P8"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[8] = true; break; - case "P9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P9"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[9] = true; break; - case "P10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P10"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[10] = true; break; - case "P11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P11"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[11] = true; break; - case "P12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P12"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[12] = true; break; - case "P13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P13"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[13] = true; break; - case "P14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P14"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[14] = true; break; - case "P15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P15"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[15] = true; break; - case "P16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P16"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[16] = true; break; - case "P17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P17"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[17] = true; break; - case "P18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P18"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[18] = true; break; - case "P19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P19"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[19] = true; break; - case "P20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P20"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[20] = true; break; - case "P21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P21"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[21] = true; break; - case "P22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P22"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[22] = true; break; - case "P23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P23"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[23] = true; break; - case "P24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P24"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[24] = true; break; - case "P25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P25"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[25] = true; break; - case "P26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P26"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[26] = true; break; - case "P27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P27"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[27] = true; break; - case "P28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P28"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[28] = true; break; - case "P29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P29"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[29] = true; break; - case "P30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P30"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[30] = true; break; - case "P31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P31"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[31] = true; break; - case "P32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P32"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[32] = true; break; - case "P33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P33"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[33] = true; break; - case "P34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P34"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[34] = true; break; - case "P35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P35"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[35] = true; break; - case "P36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P36"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[36] = true; break; - case "P37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P37"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[37] = true; break; - case "P38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P38"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[38] = true; break; - case "P39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P39"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[39] = true; break; - case "P40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P40"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[40] = true; break; - case "P41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P41"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[41] = true; break; - case "P42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P42"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[42] = true; break; - case "P43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P43"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[43] = true; break; - case "P44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P44"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[44] = true; break; - case "P45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P45"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[45] = true; break; - case "P46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P46"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[46] = true; break; - case "P47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P47"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[47] = true; break; - case "P48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P48"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[48] = true; break; - case "P49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P49"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[49] = true; break; - case "P50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P50"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[50] = true; break; - case "P51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P51"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[51] = true; break; - case "P52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P52"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[52] = true; break; - case "P53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P53"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[53] = true; break; - case "P54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P54"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[54] = true; break; - case "P55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P55"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[55] = true; break; - case "P56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P56"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[56] = true; break; - case "P57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P57"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[57] = true; break; - case "P58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P58"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[58] = true; break; - case "P59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P59"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[59] = true; break; - case "P60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P60"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[60] = true; break; - case "P61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P61"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[61] = true; break; - case "P62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P62"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[62] = true; break; - case "P63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P63"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[63] = true; break; - case "P64": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P64"u8): arg64 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[64] = true; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimplePoco/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimplePoco/FastPathJson.Person.g.cs.txt index aab51430..fd3c2645 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimplePoco/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimplePoco/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -114,7 +120,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimpleRecord/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimpleRecord/FastPathJson.Person.g.cs.txt index 3eaa5e4e..f77d71cd 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimpleRecord/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/SimpleRecord/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -115,7 +121,7 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/StructType/FastPathJson.Point.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/StructType/FastPathJson.Point.g.cs.txt index f327dfce..2b1b6bec 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/StructType/FastPathJson.Point.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/StructType/FastPathJson.Point.g.cs.txt @@ -52,6 +52,7 @@ public partial struct Point : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -59,23 +60,28 @@ public partial struct Point : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "X": + case [(byte)'X'] when global::System.MemoryExtensions.SequenceEqual(name, "X"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Y": + case [(byte)'Y'] when global::System.MemoryExtensions.SequenceEqual(name, "Y"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt index dd6ce14c..a4e3e0d1 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt @@ -91,6 +91,7 @@ public readonly partial struct Witness : global::PolyType.FastPathJson.IJsonSeri global::TestNamespace.Entry[]? arg3 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -98,33 +99,38 @@ public readonly partial struct Witness : global::PolyType.FastPathJson.IJsonSeri { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Tags": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Tags"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; - case "Batches": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Batches"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>, global::PolyType.FastPathJson.Converters.ListConverter, global::PolyType.FastPathJson.Converters.DictionaryConverter>>>(ref reader); seen |= 1UL << 1; break; - case "Bytes": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Bytes"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Children": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Children"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 3; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt index 7de95b71..82232992 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt @@ -150,6 +150,7 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( int arg8 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -157,58 +158,63 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Item3": + case [_, _, _, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "Item3"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Item4": + case [_, _, _, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "Item4"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "Item5": + case [_, _, _, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "Item5"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "Item6": + case [_, _, _, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "Item6"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "Item7": + case [_, _, _, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "Item7"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "Item8": + case [_, _, _, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "Item8"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "Item9": + case [_, _, _, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "Item9"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt index 67deddfc..9296e746 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt @@ -52,6 +52,7 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( string? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -59,23 +60,28 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt index 966e4a62..93560c8b 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt @@ -80,6 +80,7 @@ internal static partial class GeneratedJsonConverters global::TestNamespace.Tree? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -87,18 +88,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Left": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Left"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg0 is null) { @@ -108,7 +114,7 @@ internal static partial class GeneratedJsonConverters seen |= 1UL << 0; break; - case "Right": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Right"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt index ab2c2752..06c09fe3 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Debug/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt @@ -56,6 +56,7 @@ internal static partial class GeneratedJsonConverters int arg0 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -63,18 +64,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt index 3afc5102..278b0276 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/DictionaryType/FastPathJson.DictionaryHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class DictionaryHolder : global::PolyType.FastPathJson.IJsonSeria global::System.Collections.Generic.SortedList? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class DictionaryHolder : global::PolyType.FastPathJson.IJsonSeria { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Lookup": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Lookup"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.DictionaryConverter>(ref reader); seen |= 1UL << 0; break; - case "Ordered": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Ordered"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Generated.GeneratedJsonConverters.SortedList_Int32_StringConverter>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EnumType/FastPathJson.StatusHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EnumType/FastPathJson.StatusHolder.g.cs.txt index 9c3bf797..695e0e13 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EnumType/FastPathJson.StatusHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EnumType/FastPathJson.StatusHolder.g.cs.txt @@ -49,6 +49,7 @@ public partial record StatusHolder : global::PolyType.FastPathJson.IJsonSerializ global::TestNamespace.Status arg0 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -56,18 +57,23 @@ public partial record StatusHolder : global::PolyType.FastPathJson.IJsonSerializ { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..705324e4 --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/EscapedPropertyNameDiscriminators/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,198 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("'a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property1 = global::System.Text.Json.JsonEncodedText.Encode("\\a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property2 = global::System.Text.Json.JsonEncodedText.Encode("\na"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property3 = global::System.Text.Json.JsonEncodedText.Encode("\0a"); + + internal static readonly global::System.Text.Json.JsonEncodedText Property4 = global::System.Text.Json.JsonEncodedText.Encode("é"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Quote; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("'a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + + var property1 = value.Backslash; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property1, property1!); + } + else + { + writer.WritePropertyName("\\a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property1!); + } + + var property2 = value.Newline; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property2, property2!); + } + else + { + writer.WritePropertyName("\na"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property2!); + } + + var property3 = value.Null; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property3, property3!); + } + else + { + writer.WritePropertyName("\0a"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property3!); + } + + var property4 = value.Unicode; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property4, property4!); + } + else + { + writer.WritePropertyName("é"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property4!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + int arg1 = default; + int arg2 = default; + int arg3 = default; + int arg4 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case [(byte)'\'', _] when global::System.MemoryExtensions.SequenceEqual(name, "'a"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + case [(byte)'\\', _] when global::System.MemoryExtensions.SequenceEqual(name, "\\a"u8): + arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 1; + break; + + case [(byte)'\n', _] when global::System.MemoryExtensions.SequenceEqual(name, "\na"u8): + arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 2; + break; + + case [(byte)'\0', _] when global::System.MemoryExtensions.SequenceEqual(name, "\0a"u8): + arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 3; + break; + + case [(byte)'Ã', _] when global::System.MemoryExtensions.SequenceEqual(name, "é"u8): + arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 4; + break; + + default: + reader.Skip(); + break; + } + } + + if ((seen & 0x1FUL) != 0x1FUL) + { + ThrowMissingRequiredParameters(0x1FUL & ~seen); + } + + var result = new global::TestNamespace.Payload(arg0!, arg1!, arg2!, arg3!, arg4!); + + return result; + + [global::System.Diagnostics.CodeAnalysis.DoesNotReturn] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] + static void ThrowMissingRequiredParameters(ulong missing) + { + var names = new global::System.Collections.Generic.List(); + + while (missing != 0) + { + int index = global::System.Numerics.BitOperations.TrailingZeroCount(missing); + string name = index switch + { + 0 => "'a", + 1 => "\\a", + 2 => "\na", + 3 => "\0a", + 4 => "é", + _ => throw new global::System.InvalidOperationException("Invalid required constructor parameter index."), + }; + + names.Add(name); + missing &= missing - 1; + } + + global::PolyType.FastPathJson.SerializationHelpers.ThrowMissingRequiredParameters(names); + } + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt index 026dcb2f..191580ef 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.PersonConverter.g.cs.txt @@ -70,6 +70,7 @@ internal static partial class GeneratedJsonConverters int arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -77,18 +78,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg0 is null) { @@ -98,7 +104,7 @@ internal static partial class GeneratedJsonConverters seen |= 1UL << 0; break; - case "Age": + case { Length: 3 } when global::System.MemoryExtensions.SequenceEqual(name, "Age"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt index 829b47ff..bbced96d 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FoldedWitness/FastPathJson.Converters.ValueTuple_Person_Array_DoubleConverter.g.cs.txt @@ -54,6 +54,7 @@ internal static partial class GeneratedJsonConverters double[]? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -61,23 +62,28 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FusedScalarProperties/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FusedScalarProperties/FastPathJson.Payload.g.cs.txt index ca46cbb8..8d9353e8 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FusedScalarProperties/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/FusedScalarProperties/FastPathJson.Payload.g.cs.txt @@ -203,6 +203,7 @@ public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable< int? arg11 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -210,73 +211,78 @@ public partial record Payload : global::PolyType.FastPathJson.IJsonSerializable< { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Flag": + case [(byte)'F', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Flag"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Number": + case [(byte)'N', _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Number"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Ratio": + case [(byte)'R', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Ratio"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Amount": + case [(byte)'A', _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Amount"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "Text": + case [(byte)'T', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Text"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "Date": + case [(byte)'D', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Date"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "Timestamp": + case [(byte)'T', _, _, _, _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Timestamp"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "Link": + case [(byte)'L', _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Link"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; - case "Character": + case [(byte)'C', _, _, _, _, _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Character"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 9; break; - case "Bytes": + case [(byte)'B', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "Bytes"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 10; break; - case "Optional": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Optional"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 11; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/JsonMetadata/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/JsonMetadata/FastPathJson.Person.g.cs.txt index 278030e2..b1efa54e 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/JsonMetadata/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/JsonMetadata/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -115,7 +121,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/KeywordMembers/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/KeywordMembers/FastPathJson.Payload.g.cs.txt index c2d72791..5687ba59 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/KeywordMembers/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/KeywordMembers/FastPathJson.Payload.g.cs.txt @@ -91,6 +91,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -98,33 +99,38 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Ordered": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Ordered"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "class": + case [(byte)'c', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "class"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "event": + case [(byte)'e', _, _, _, _] when global::System.MemoryExtensions.SequenceEqual(name, "event"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "required": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "required"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/ListCollection/FastPathJson.ListHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/ListCollection/FastPathJson.ListHolder.g.cs.txt index 053bc6f3..e9c7a188 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/ListCollection/FastPathJson.ListHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/ListCollection/FastPathJson.ListHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class ListHolder : global::PolyType.FastPathJson.IJsonSerializabl int[]? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class ListHolder : global::PolyType.FastPathJson.IJsonSerializabl { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Items": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Items"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.ListConverter>(ref reader); seen |= 1UL << 0; break; - case "Values": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Values"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt index a3b5af38..a564fde1 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/MixedRequiredMembers/FastPathJson.Payload.g.cs.txt @@ -959,6 +959,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -966,343 +967,348 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "O0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "O0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[65] = true; break; - case "R0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R0"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[0] = true; break; - case "R1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R1"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[1] = true; break; - case "R2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R2"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[2] = true; break; - case "R3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R3"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[3] = true; break; - case "R4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R4"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[4] = true; break; - case "R5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R5"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[5] = true; break; - case "R6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R6"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[6] = true; break; - case "R7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R7"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[7] = true; break; - case "R8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R8"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[8] = true; break; - case "R9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R9"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[9] = true; break; - case "R10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R10"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[10] = true; break; - case "R11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R11"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[11] = true; break; - case "R12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R12"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[12] = true; break; - case "R13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R13"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[13] = true; break; - case "R14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R14"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[14] = true; break; - case "R15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R15"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[15] = true; break; - case "R16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R16"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[16] = true; break; - case "R17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R17"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[17] = true; break; - case "R18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R18"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[18] = true; break; - case "R19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R19"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[19] = true; break; - case "R20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R20"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[20] = true; break; - case "R21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R21"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[21] = true; break; - case "R22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R22"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[22] = true; break; - case "R23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R23"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[23] = true; break; - case "R24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R24"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[24] = true; break; - case "R25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R25"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[25] = true; break; - case "R26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R26"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[26] = true; break; - case "R27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R27"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[27] = true; break; - case "R28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R28"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[28] = true; break; - case "R29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R29"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[29] = true; break; - case "R30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R30"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[30] = true; break; - case "R31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R31"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[31] = true; break; - case "R32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R32"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[32] = true; break; - case "R33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R33"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[33] = true; break; - case "R34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R34"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[34] = true; break; - case "R35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R35"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[35] = true; break; - case "R36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R36"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[36] = true; break; - case "R37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R37"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[37] = true; break; - case "R38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R38"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[38] = true; break; - case "R39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R39"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[39] = true; break; - case "R40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R40"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[40] = true; break; - case "R41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R41"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[41] = true; break; - case "R42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R42"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[42] = true; break; - case "R43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R43"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[43] = true; break; - case "R44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R44"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[44] = true; break; - case "R45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R45"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[45] = true; break; - case "R46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R46"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[46] = true; break; - case "R47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R47"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[47] = true; break; - case "R48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R48"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[48] = true; break; - case "R49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R49"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[49] = true; break; - case "R50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R50"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[50] = true; break; - case "R51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R51"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[51] = true; break; - case "R52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R52"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[52] = true; break; - case "R53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R53"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[53] = true; break; - case "R54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R54"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[54] = true; break; - case "R55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "R55"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[55] = true; break; - case "R56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "R56"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[56] = true; break; - case "R57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "R57"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[57] = true; break; - case "R58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "R58"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[58] = true; break; - case "R59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "R59"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[59] = true; break; - case "R60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "R60"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[60] = true; break; - case "R61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "R61"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[61] = true; break; - case "R62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "R62"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[62] = true; break; - case "R63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "R63"u8): arg64 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[63] = true; break; - case "R64": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "R64"u8): arg65 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[64] = true; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/NullableValueType/FastPathJson.NullableHolder.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/NullableValueType/FastPathJson.NullableHolder.g.cs.txt index 9e4dc595..0edcdb64 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/NullableValueType/FastPathJson.NullableHolder.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/NullableValueType/FastPathJson.NullableHolder.g.cs.txt @@ -63,6 +63,7 @@ public partial class NullableHolder : global::PolyType.FastPathJson.IJsonSeriali global::System.DateTime? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -70,23 +71,28 @@ public partial class NullableHolder : global::PolyType.FastPathJson.IJsonSeriali { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Number": + case { Length: 6 } when global::System.MemoryExtensions.SequenceEqual(name, "Number"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; - case "Date": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Date"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..32beef8f --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer42/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,96 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("éééééééééééééééééééééééééééééééééééééééééé"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Value; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("éééééééééééééééééééééééééééééééééééééééééé"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case { Length: 84 } when global::System.MemoryExtensions.SequenceEqual(name, "éééééééééééééééééééééééééééééééééééééééééé"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + default: + reader.Skip(); + break; + } + } + + var result = new global::TestNamespace.Payload(); + + if ((seen & (1UL << 0)) != 0) + { + result.Value = arg0!; + } + + return result; + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt new file mode 100644 index 00000000..af90130c --- /dev/null +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/PropertyNameBuffer43/FastPathJson.Payload.g.cs.txt @@ -0,0 +1,102 @@ +// +// Attribute type arguments do not encode nullable-reference annotations. +#nullable disable + +namespace TestNamespace; + +public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable +{ + #nullable enable annotations + + private static class __JsonPropertyNames_PayloadConverter + { + internal static readonly global::System.Text.Json.JsonEncodedText Property0 = global::System.Text.Json.JsonEncodedText.Encode("ééééééééééééééééééééééééééééééééééééééééééé"); + } + + static void global::PolyType.FastPathJson.IJsonSerializable.Write(global::System.Text.Json.Utf8JsonWriter writer, global::TestNamespace.Payload? value) + { + if (value is null) + { + writer.WriteNullValue(); + return; + } + + bool useCachedPropertyNames = global::PolyType.FastPathJson.SerializationHelpers.UsesDefaultEncoder(writer); + + writer.WriteStartObject(); + var property0 = value.Value; + if (useCachedPropertyNames) + { + writer.WriteNumber(__JsonPropertyNames_PayloadConverter.Property0, property0!); + } + else + { + writer.WritePropertyName("ééééééééééééééééééééééééééééééééééééééééééé"); + global::PolyType.FastPathJson.SerializationHelpers.Write(writer, property0!); + } + writer.WriteEndObject(); + } + + static global::TestNamespace.Payload? global::PolyType.FastPathJson.IJsonSerializable.Read(ref global::System.Text.Json.Utf8JsonReader reader) + { + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Null) + { + return null; + } + + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.StartObject); + + int arg0 = default; + ulong seen = 0; + + global::System.Span propertyNameBuffer = stackalloc byte[256]; + byte[]? rentedPropertyNameBuffer = null; + try + { + while (true) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + if (reader.TokenType is global::System.Text.Json.JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); + } + + global::System.ReadOnlySpan name = global::PolyType.FastPathJson.SerializationHelpers.GetUtf8PropertyName(in reader, propertyNameBuffer, ref rentedPropertyNameBuffer); + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + + switch (name) + { + case { Length: 86 } when global::System.MemoryExtensions.SequenceEqual(name, "ééééééééééééééééééééééééééééééééééééééééééé"u8): + arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); + seen |= 1UL << 0; + break; + + default: + reader.Skip(); + break; + } + } + } + finally + { + if (rentedPropertyNameBuffer is not null) + { + global::System.Buffers.ArrayPool.Shared.Return(rentedPropertyNameBuffer); + } + } + + var result = new global::TestNamespace.Payload(); + + if ((seen & (1UL << 0)) != 0) + { + result.Value = arg0!; + } + + return result; + } +} diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RecursiveObject/FastPathJson.Node.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RecursiveObject/FastPathJson.Node.g.cs.txt index 3a8dcca2..70f9f83a 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RecursiveObject/FastPathJson.Node.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RecursiveObject/FastPathJson.Node.g.cs.txt @@ -77,6 +77,7 @@ public partial class Node : global::PolyType.FastPathJson.IJsonSerializable? arg2 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -84,28 +85,33 @@ public partial class Node : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Next": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Next"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Children": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Children"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read, global::PolyType.FastPathJson.Converters.ListConverter>(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties64/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties64/FastPathJson.Payload.g.cs.txt index a8d47ef0..399751b9 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties64/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties64/FastPathJson.Payload.g.cs.txt @@ -931,6 +931,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -938,333 +939,338 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "P0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "P1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P1"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "P2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P2"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "P3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P3"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "P4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P4"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "P5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P5"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "P6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P6"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "P7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P7"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "P8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P8"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; - case "P9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P9"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 9; break; - case "P10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P10"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 10; break; - case "P11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P11"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 11; break; - case "P12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P12"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 12; break; - case "P13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P13"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 13; break; - case "P14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P14"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 14; break; - case "P15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P15"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 15; break; - case "P16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P16"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 16; break; - case "P17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P17"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 17; break; - case "P18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P18"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 18; break; - case "P19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P19"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 19; break; - case "P20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P20"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 20; break; - case "P21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P21"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 21; break; - case "P22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P22"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 22; break; - case "P23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P23"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 23; break; - case "P24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P24"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 24; break; - case "P25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P25"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 25; break; - case "P26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P26"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 26; break; - case "P27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P27"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 27; break; - case "P28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P28"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 28; break; - case "P29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P29"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 29; break; - case "P30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P30"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 30; break; - case "P31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P31"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 31; break; - case "P32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P32"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 32; break; - case "P33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P33"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 33; break; - case "P34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P34"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 34; break; - case "P35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P35"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 35; break; - case "P36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P36"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 36; break; - case "P37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P37"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 37; break; - case "P38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P38"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 38; break; - case "P39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P39"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 39; break; - case "P40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P40"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 40; break; - case "P41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P41"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 41; break; - case "P42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P42"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 42; break; - case "P43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P43"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 43; break; - case "P44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P44"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 44; break; - case "P45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P45"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 45; break; - case "P46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P46"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 46; break; - case "P47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P47"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 47; break; - case "P48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P48"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 48; break; - case "P49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P49"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 49; break; - case "P50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P50"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 50; break; - case "P51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P51"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 51; break; - case "P52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P52"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 52; break; - case "P53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P53"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 53; break; - case "P54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P54"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 54; break; - case "P55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P55"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 55; break; - case "P56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P56"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 56; break; - case "P57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P57"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 57; break; - case "P58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P58"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 58; break; - case "P59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P59"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 59; break; - case "P60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P60"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 60; break; - case "P61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P61"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 61; break; - case "P62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P62"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 62; break; - case "P63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P63"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 63; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties65/FastPathJson.Payload.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties65/FastPathJson.Payload.g.cs.txt index a52ee568..c280deb6 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties65/FastPathJson.Payload.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/RequiredProperties65/FastPathJson.Payload.g.cs.txt @@ -945,6 +945,7 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -952,338 +953,343 @@ public partial class Payload : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "P0": + case [_, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P0"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[0] = true; break; - case "P1": + case [_, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P1"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[1] = true; break; - case "P2": + case [_, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P2"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[2] = true; break; - case "P3": + case [_, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P3"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[3] = true; break; - case "P4": + case [_, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P4"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[4] = true; break; - case "P5": + case [_, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P5"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[5] = true; break; - case "P6": + case [_, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P6"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[6] = true; break; - case "P7": + case [_, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P7"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[7] = true; break; - case "P8": + case [_, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P8"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[8] = true; break; - case "P9": + case [_, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P9"u8): arg9 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[9] = true; break; - case "P10": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P10"u8): arg10 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[10] = true; break; - case "P11": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P11"u8): arg11 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[11] = true; break; - case "P12": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P12"u8): arg12 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[12] = true; break; - case "P13": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P13"u8): arg13 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[13] = true; break; - case "P14": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P14"u8): arg14 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[14] = true; break; - case "P15": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P15"u8): arg15 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[15] = true; break; - case "P16": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P16"u8): arg16 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[16] = true; break; - case "P17": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P17"u8): arg17 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[17] = true; break; - case "P18": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P18"u8): arg18 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[18] = true; break; - case "P19": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P19"u8): arg19 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[19] = true; break; - case "P20": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P20"u8): arg20 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[20] = true; break; - case "P21": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P21"u8): arg21 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[21] = true; break; - case "P22": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P22"u8): arg22 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[22] = true; break; - case "P23": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P23"u8): arg23 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[23] = true; break; - case "P24": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P24"u8): arg24 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[24] = true; break; - case "P25": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P25"u8): arg25 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[25] = true; break; - case "P26": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P26"u8): arg26 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[26] = true; break; - case "P27": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P27"u8): arg27 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[27] = true; break; - case "P28": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P28"u8): arg28 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[28] = true; break; - case "P29": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P29"u8): arg29 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[29] = true; break; - case "P30": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P30"u8): arg30 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[30] = true; break; - case "P31": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P31"u8): arg31 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[31] = true; break; - case "P32": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P32"u8): arg32 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[32] = true; break; - case "P33": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P33"u8): arg33 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[33] = true; break; - case "P34": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P34"u8): arg34 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[34] = true; break; - case "P35": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P35"u8): arg35 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[35] = true; break; - case "P36": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P36"u8): arg36 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[36] = true; break; - case "P37": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P37"u8): arg37 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[37] = true; break; - case "P38": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P38"u8): arg38 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[38] = true; break; - case "P39": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P39"u8): arg39 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[39] = true; break; - case "P40": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P40"u8): arg40 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[40] = true; break; - case "P41": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P41"u8): arg41 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[41] = true; break; - case "P42": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P42"u8): arg42 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[42] = true; break; - case "P43": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P43"u8): arg43 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[43] = true; break; - case "P44": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P44"u8): arg44 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[44] = true; break; - case "P45": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P45"u8): arg45 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[45] = true; break; - case "P46": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P46"u8): arg46 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[46] = true; break; - case "P47": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P47"u8): arg47 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[47] = true; break; - case "P48": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P48"u8): arg48 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[48] = true; break; - case "P49": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P49"u8): arg49 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[49] = true; break; - case "P50": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P50"u8): arg50 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[50] = true; break; - case "P51": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P51"u8): arg51 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[51] = true; break; - case "P52": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P52"u8): arg52 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[52] = true; break; - case "P53": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P53"u8): arg53 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[53] = true; break; - case "P54": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P54"u8): arg54 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[54] = true; break; - case "P55": + case [_, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "P55"u8): arg55 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[55] = true; break; - case "P56": + case [_, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "P56"u8): arg56 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[56] = true; break; - case "P57": + case [_, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "P57"u8): arg57 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[57] = true; break; - case "P58": + case [_, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "P58"u8): arg58 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[58] = true; break; - case "P59": + case [_, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "P59"u8): arg59 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[59] = true; break; - case "P60": + case [_, _, (byte)'0'] when global::System.MemoryExtensions.SequenceEqual(name, "P60"u8): arg60 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[60] = true; break; - case "P61": + case [_, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "P61"u8): arg61 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[61] = true; break; - case "P62": + case [_, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "P62"u8): arg62 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[62] = true; break; - case "P63": + case [_, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "P63"u8): arg63 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[63] = true; break; - case "P64": + case [_, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "P64"u8): arg64 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen[64] = true; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimplePoco/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimplePoco/FastPathJson.Person.g.cs.txt index aab51430..fd3c2645 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimplePoco/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimplePoco/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -114,7 +120,7 @@ public partial class Person : global::PolyType.FastPathJson.IJsonSerializable>(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimpleRecord/FastPathJson.Person.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimpleRecord/FastPathJson.Person.g.cs.txt index 3eaa5e4e..f77d71cd 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimpleRecord/FastPathJson.Person.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/SimpleRecord/FastPathJson.Person.g.cs.txt @@ -82,6 +82,7 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -89,23 +90,28 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Id": + case { Length: 2 } when global::System.MemoryExtensions.SequenceEqual(name, "Id"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Name": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Name"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { @@ -115,7 +121,7 @@ public partial record Person : global::PolyType.FastPathJson.IJsonSerializable(ref reader); seen |= 1UL << 2; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/StructType/FastPathJson.Point.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/StructType/FastPathJson.Point.g.cs.txt index f327dfce..2b1b6bec 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/StructType/FastPathJson.Point.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/StructType/FastPathJson.Point.g.cs.txt @@ -52,6 +52,7 @@ public partial struct Point : global::PolyType.FastPathJson.IJsonSerializable propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -59,23 +60,28 @@ public partial struct Point : global::PolyType.FastPathJson.IJsonSerializable name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "X": + case [(byte)'X'] when global::System.MemoryExtensions.SequenceEqual(name, "X"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Y": + case [(byte)'Y'] when global::System.MemoryExtensions.SequenceEqual(name, "Y"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt index dd6ce14c..a4e3e0d1 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TransitiveCollections/FastPathJson.Witness.Entry.g.cs.txt @@ -91,6 +91,7 @@ public readonly partial struct Witness : global::PolyType.FastPathJson.IJsonSeri global::TestNamespace.Entry[]? arg3 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -98,33 +99,38 @@ public readonly partial struct Witness : global::PolyType.FastPathJson.IJsonSeri { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Tags": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Tags"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 0; break; - case "Batches": + case { Length: 7 } when global::System.MemoryExtensions.SequenceEqual(name, "Batches"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read>, global::PolyType.FastPathJson.Converters.ListConverter, global::PolyType.FastPathJson.Converters.DictionaryConverter>>>(ref reader); seen |= 1UL << 1; break; - case "Bytes": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Bytes"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Children": + case { Length: 8 } when global::System.MemoryExtensions.SequenceEqual(name, "Children"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read>(ref reader); seen |= 1UL << 3; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt index 7de95b71..82232992 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32_Int32.g.cs.txt @@ -150,6 +150,7 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( int arg8 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -157,58 +158,63 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; - case "Item3": + case [_, _, _, _, (byte)'3'] when global::System.MemoryExtensions.SequenceEqual(name, "Item3"u8): arg2 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 2; break; - case "Item4": + case [_, _, _, _, (byte)'4'] when global::System.MemoryExtensions.SequenceEqual(name, "Item4"u8): arg3 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 3; break; - case "Item5": + case [_, _, _, _, (byte)'5'] when global::System.MemoryExtensions.SequenceEqual(name, "Item5"u8): arg4 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 4; break; - case "Item6": + case [_, _, _, _, (byte)'6'] when global::System.MemoryExtensions.SequenceEqual(name, "Item6"u8): arg5 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 5; break; - case "Item7": + case [_, _, _, _, (byte)'7'] when global::System.MemoryExtensions.SequenceEqual(name, "Item7"u8): arg6 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 6; break; - case "Item8": + case [_, _, _, _, (byte)'8'] when global::System.MemoryExtensions.SequenceEqual(name, "Item8"u8): arg7 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 7; break; - case "Item9": + case [_, _, _, _, (byte)'9'] when global::System.MemoryExtensions.SequenceEqual(name, "Item9"u8): arg8 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 8; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt index 67deddfc..9296e746 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TupleType/FastPathJson.Witness.ValueTuple_Int32_String.g.cs.txt @@ -52,6 +52,7 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( string? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -59,23 +60,28 @@ public partial class Witness : global::PolyType.FastPathJson.IJsonSerializable<( { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Item1": + case [_, _, _, _, (byte)'1'] when global::System.MemoryExtensions.SequenceEqual(name, "Item1"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break; - case "Item2": + case [_, _, _, _, (byte)'2'] when global::System.MemoryExtensions.SequenceEqual(name, "Item2"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 1; break; diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt index 966e4a62..93560c8b 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.BranchConverter.g.cs.txt @@ -80,6 +80,7 @@ internal static partial class GeneratedJsonConverters global::TestNamespace.Tree? arg1 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -87,18 +88,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Left": + case { Length: 4 } when global::System.MemoryExtensions.SequenceEqual(name, "Left"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg0 is null) { @@ -108,7 +114,7 @@ internal static partial class GeneratedJsonConverters seen |= 1UL << 0; break; - case "Right": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Right"u8): arg1 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); if (arg1 is null) { diff --git a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt index ab2c2752..06c09fe3 100644 --- a/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt +++ b/tests/PolyType.FastPathJson.Tests/Snapshots/net10.0-Release/TypeHierarchy/FastPathJson.Converters.LeafConverter.g.cs.txt @@ -56,6 +56,7 @@ internal static partial class GeneratedJsonConverters int arg0 = default; ulong seen = 0; + global::System.Span propertyNameBuffer = stackalloc byte[256]; while (true) { global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); @@ -63,18 +64,23 @@ internal static partial class GeneratedJsonConverters { break; } - + if (reader.TokenType is global::System.Text.Json.JsonTokenType.Comment) { global::PolyType.FastPathJson.SerializationHelpers.EnsureToken(ref reader, global::System.Text.Json.JsonTokenType.PropertyName); } - - string name = reader.GetString()!; + + if (!global::PolyType.FastPathJson.SerializationHelpers.TryGetUtf8PropertyName(in reader, propertyNameBuffer, out global::System.ReadOnlySpan name)) + { + global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); + reader.Skip(); + continue; + } global::PolyType.FastPathJson.SerializationHelpers.EnsureRead(ref reader); - + switch (name) { - case "Value": + case { Length: 5 } when global::System.MemoryExtensions.SequenceEqual(name, "Value"u8): arg0 = global::PolyType.FastPathJson.SerializationHelpers.Read(ref reader); seen |= 1UL << 0; break;