Skip to content

v4.0.0-rc.9

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 04:06
· 57 commits to main since this release

Install: dotnet add package Nino --version 4.0.0-rc.9 (Unity package: 4.0.0-preview.209)

Other languages: go get github.com/JasonXuDeveloper/Nino/runtimes/go/v4@v4.0.0-rc.9, cargo add nino-serialization@=4.0.0-rc.9, npm install nino-serialization@4.0.0-rc.9.

New

  • NinoHeader.Presence replaces NinoHeader.NullFlag, and published layouts say header=Presence (NinoTypeLayoutAttribute.ToString(), the Go and Rust layout strings); NullFlag is removed.
  • NinoPolymorphic.TryRegister<T>() and TryRegister(Type) replace Register<T>() and Register(Type), which are removed; they return false when the type cannot be registered.
  • NinoDeserializer.Deserialize<T>(ref Reader reader, ref T value) and DeserializeBoxed(ref Reader reader, ref object value, Type type) take the reader first, like every other read; the value-first overloads are removed.
  • [NinoType(inheritedBySubtypes: false)] replaces allowInheritance: false (and NinoTypeAttribute.InheritedBySubtypes replaces AllowInheritance); the old name is removed, and a code fix renames a named allowInheritance: argument.
  • Analyzer warning NINO030 reports a [NinoUtf8] that has no effect (no string in the member's type, or a [NinoMemberFormatter] writes it), with a code fix that removes it.
  • [NinoMemberFormatter(typeof(Utf8StringFormatter))] on a string member is now read as [NinoUtf8] (same bytes, utf8 in the published layout); info NINO031 and its code fix rewrite it to [NinoUtf8].
  • WEAK_VERSION_TOLERANCE is removed. Where a project still defines it, error NINO032 marks each type that would turn positional, and its code fix adds format: NinoFormat.VersionTolerant, which keeps the same bytes (fix all applies it to the whole solution).
  • Published layouts write the type id as id=0x... (was typeId=), and NinoTypeLayoutAttribute's constructor parameter is id, matching its Id property; Go and Rust layout strings use id= too.
  • Custom formatters implement Deserialize(ref Reader reader, ref T value): the reader comes first, as in NinoDeserializer; the old order is removed, so swap the two parameters in your formatters.
  • The code fix for [NinoType(containNonPublicMembers: ...)] (the v3 name) renames it to includeNonPublicMembers.
  • Warning NINO033 reports [NinoUtf8], [NinoMemberFormatter] and [NinoIgnore] on an interface member, where they have no effect (implementing types write their own member with its own attributes); its code fix moves the attribute to the implementing members.
  • Rust: the type id nino-gen declares on each generated type is now NINO_TYPE_ID (was TYPE_ID), named like NINO_TYPE_NAME and NINO_LAYOUT; regenerate, and write Cat::NINO_TYPE_ID where code named Cat::TYPE_ID (the body traits' TYPE_ID is unchanged).

Performance

  • In the IDE, an edit that changes no declaration no longer makes the source generator bind every top-level Serialize/Deserialize call again, so typing in a project with many such calls costs the generator much less.
  • Reading a list of plain structs with NinoSettings.Untrusted checks a bool field in the same SIMD pass as its neighbours: 11-20 % faster on x64 including rc.9's over-read fix (EPYC 7763: 2.70 → 2.40 µs for 1,000 values; EPYC 9V45: 1.40 → 1.11 µs; runs 42341861781 and 42365821207), on par on Arm64.

Fixes

  • NINO007 and NINO029 are reported once for a member of a base type instead of once per subtype; NINO030 now reports [NinoUtf8] on members that are never serialized and on interface members, where it has no effect.
  • An explicit implementation of a [NinoType] interface's property (int IFoo.X { get; set; }) no longer breaks the build with CS1061: it is serialized through the interface, without boxing structs, with the interface member's [NinoUtf8], [NinoMemberFormatter] and [NinoIgnore], in the same layout as an implicit implementation; NINO033 no longer reports those attributes where such an implementation makes them take effect.
  • Reading a Dictionary of plain struct values with NinoSettings.Untrusted (such as Dictionary<long, DateTime>) no longer reads up to a key's size past the end of the input, which could crash the process when the input ended at a page boundary.
  • Rust code generated by nino-gen reads a HashSet<string> (any string set, [NinoUtf8] included) that holds null, as .NET writes it: its elements are now Option<WideString> / Option<String> / Option<Utf8>. Breaking for Rust code that builds or reads such sets (IndexSet<String> becomes IndexSet<Option<String>>).

Every change between v4 releases: Changelog.

What's Changed since v4.0.0-rc.8

106 commits

⚠️ Breaking changes

✨ Features

⚡ Performance

🐛 Fixes

♻️ Refactoring and cleanup (30)
📖 Documentation (36)
🧪 Tests (12)
🔧 Build, CI and dependencies (7)

Contributors

Thanks to everyone who contributed to this release: @JasonXuDeveloper

Full Changelog: v4.0.0-rc.8...v4.0.0-rc.9

📊 v3 3.3.13 vs v4 (same machine)

Nino v3 3.3.13 (NuGet) against v4.0.0-rc.9, back to back on the same runners

The v3 build of benchmarks/Nino.Benchmark (the Nino and MemoryPack cases of the same SimpleTest, built against Nino 3.3.13 from nuget.org) ran directly before the v4
SimpleTest run below, its serialize and its deserialize cases each on the runner of the same v4 cases, with
the same BenchmarkDotNet settings
(--launchCount 3 --warmupCount 5 --iterationCount 15). MemoryPack runs in both, so its two columns show how much the runner moved.

v4 vs v3

case v3 3.3.13 v4 v4 vs v3 MemoryPack (v4 run) MemoryPack (v3 run)
SerializeSimpleClass 119.67 ns 56.76 ns 0.47x 230.55 ns 236.10 ns
SerializeSimpleClasses 16.39 μs 6.58 μs 0.40x 23.28 μs 24.14 μs
SerializeSimpleStruct 1.59 ns 1.16 ns 0.73x 2.87 ns 2.68 ns
SerializeSimpleStructs 11.96 ns 11.49 ns 0.96x 13.53 ns 12.65 ns
SerializeVectors 3.35 μs 3.38 μs 1.01x 3.31 μs 3.36 μs
DeserializeSimpleClass 528.26 ns 339.85 ns 0.64x 706.34 ns 709.06 ns
DeserializeSimpleClasses 55.81 μs 36.04 μs 0.65x 69.12 μs 69.60 μs
DeserializeSimpleStruct 0.70 ns 0.76 ns on par (both too fast to measure) 1.40 ns 1.47 ns
DeserializeSimpleStructs 81.91 ns 81.72 ns 1.00x 96.51 ns 97.59 ns
DeserializeVectors 118.09 μs 120.14 μs 1.02x 118.77 μs 120.10 μs

v4 vs v3 = mean(v4) / mean(v3); below 1.00x means v4 is faster.
MemoryPack drift (v4 run / v3 run): min 0.95x, max 1.07x (same code in both runs; the spread is the noise floor of this comparison).

v3 3.3.13 runners


BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
Intel Xeon 6973P-C 3.80GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.403
  [Host]             : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v4
  ShortRun-.NET 10.0 : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v4

Job=ShortRun-.NET 10.0  Runtime=.NET 10.0  Server=True  
IterationCount=15  LaunchCount=3  WarmupCount=5  

The cases ran in parallel on several runners (every serializer's run of a case on one):

  • SimpleTest (NinoSerializeSimpleClass to MemoryPackSerializeVectors): Intel Xeon 6973P-C 3.80GHz, 1 CPU, 4 logical and 2 physical cores
  • SimpleTest (NinoDeserializeSimpleClass to MemoryPackDeserializeVectors): AMD EPYC 7763 3.15GHz, 1 CPU, 4 logical and 2 physical cores

The v3 report: benchmark-v3-full.md.

📊 Arm64 benchmark

The Arm64 report is attached to this release: arm64-benchmark.md (the release notes have no room for it).

📊 Performance Report

Click to expand benchmark results

BenchmarkDotNet v0.15.8, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
Intel Xeon 6973P-C 3.54GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.403
  [Host]             : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v4
  ShortRun-.NET 10.0 : .NET 10.0.14 (10.0.14, 10.0.1426.52326), X64 RyuJIT x86-64-v4

Job=ShortRun-.NET 10.0  Runtime=.NET 10.0  Server=True  
IterationCount=15  LaunchCount=3  WarmupCount=5  

ReferenceTest

Method Mean Ratio Payload Allocated
NinoDeserializeGraph 4.56 μs 1.00 - 14104 B
MemoryPackDeserializeGraph 13.75 μs 3.02 - 14104 B
NinoSerializeGraph 3.49 μs 1.00 5,830 B -
MemoryPackSerializeGraph 18.45 μs 5.29 5,584 B -

PooledTest

Method Mean Ratio Payload Allocated
NinoDeserializeNew 286.82 ns 1.00 - 2296 B
NinoDeserializePooled 144.97 ns 0.51 - -
MemoryPackDeserializeNew 486.40 ns 1.70 - 2536 B
MessagePackDeserializeNew 1.21 μs 4.22 - 2536 B
ProtobufDeserializeNew 4.01 μs 13.98 - -
MemoryPackDeserializeOverwrite 404.92 ns 1.41 - 1080 B

ScatteredTest

Method Mean Ratio Payload Allocated
NinoDeserializeScatteredItemsInto 16.52 ms 1.00 - -
MemoryPackDeserializeScatteredItemsInto 42.44 ms 2.58 - 47920000 B
NinoSerializeScatteredItems 40.74 ms 1.01 24,888,894 B -
MemoryPackSerializeScatteredItems 101.41 ms 2.51 31,888,894 B -
MessagePackSerializeScatteredItems 80.04 ms 1.98 22,738,657 B -
ProtobufSerializeScatteredItems 164.76 ms 4.07 23,570,420 B -
NinoSerializeInOrderShapes 1.66 ms 1.00 14,000,004 B -
MemoryPackSerializeInOrderShapes 12.74 ms 7.67 12,000,004 B -
MessagePackSerializeInOrderShapes 19.79 ms 11.92 15,368,549 B -
ProtobufSerializeInOrderShapes 69.06 ms 41.59 16,483,481 B -
NinoSerializeScatteredShapes 18.10 ms 1.00 14,000,004 B -
MemoryPackSerializeScatteredShapes 71.80 ms 3.98 12,000,004 B -
MessagePackSerializeScatteredShapes 115.13 ms 6.39 15,368,549 B -
ProtobufSerializeScatteredShapes 166.70 ms 9.25 16,483,481 B -
NinoSerializeHotShapes 7.82 μs 1.00 114,692 B -
MemoryPackSerializeHotShapes 96.94 μs 12.41 98,308 B -
MessagePackSerializeHotShapes 144.50 μs 18.50 110,211 B -
ProtobufSerializeHotShapes 524.45 μs 67.16 126,841 B -

SimpleTest

Method Mean Ratio Payload Allocated
NinoSerializeSimpleClass 56.76 ns 1.00 1,069 B -
MemoryPackSerializeSimpleClass 230.55 ns 4.06 1,148 B -
MessagePackSerializeSimpleClass 555.31 ns 9.79 1,068 B -
ProtobufSerializeSimpleClass 2.55 μs 44.90 1,257 B 80 B
NinoSerializeSimpleClasses 6.58 μs 1.00 106,904 B -
MemoryPackSerializeSimpleClasses 23.28 μs 3.54 114,804 B -
MessagePackSerializeSimpleClasses 55.53 μs 8.44 106,803 B -
ProtobufSerializeSimpleClasses 267.65 μs 40.70 125,460 B 8000 B
NinoSerializeSimpleStruct 1.16 ns 1.00 12 B -
MemoryPackSerializeSimpleStruct 2.87 ns 2.48 12 B -
MessagePackSerializeSimpleStruct 35.02 ns 30.28 12 B -
ProtobufSerializeSimpleStruct 92.55 ns 80.03 16 B -
NinoSerializeSimpleStructs 11.49 ns 1.00 1,204 B -
MemoryPackSerializeSimpleStructs 13.53 ns 1.18 1,204 B -
MessagePackSerializeSimpleStructs 2.13 μs 185.66 1,203 B -
ProtobufSerializeSimpleStructs 7.02 μs 611.23 1,784 B -
NinoSerializeVectors 3.38 μs 1.00 160,004 B -
MemoryPackSerializeVectors 3.31 μs 0.98 160,004 B -
MessagePackSerializeVectors 90.87 μs 26.91 210,003 B -
ProtobufSerializeVectors 412.51 μs 122.18 220,000 B -
NinoDeserializeSimpleClass 339.85 ns 1.00 - 2288 B
MemoryPackDeserializeSimpleClass 706.34 ns 2.08 - 2528 B
MessagePackDeserializeSimpleClass 1.76 μs 5.17 - 2528 B
ProtobufDeserializeSimpleClass 6.26 μs 18.42 - -
NinoDeserializeSimpleClasses 36.04 μs 1.00 - 229624 B
MemoryPackDeserializeSimpleClasses 69.12 μs 1.92 - 253624 B
MessagePackDeserializeSimpleClasses 190.63 μs 5.29 - 253624 B
ProtobufDeserializeSimpleClasses 602.09 μs 16.71 - 354424 B
NinoDeserializeSimpleStruct 0.76 ns 1.00 - -
MemoryPackDeserializeSimpleStruct 1.40 ns 1.86 - -
MessagePackDeserializeSimpleStruct 77.17 ns 102.30 - -
ProtobufDeserializeSimpleStruct 230.54 ns 305.61 - -
NinoDeserializeSimpleStructs 81.72 ns 1.00 - 1224 B
MemoryPackDeserializeSimpleStructs 96.51 ns 1.18 - 1224 B
MessagePackDeserializeSimpleStructs 3.41 μs 41.68 - -
ProtobufDeserializeSimpleStructs 10.12 μs 123.81 - 1224 B
NinoDeserializeVectors 120.14 μs 1.00 - 160032 B
MemoryPackDeserializeVectors 118.77 μs 0.99 - 160033 B
MessagePackDeserializeVectors 372.99 μs 3.11 - 160035 B
ProtobufDeserializeVectors 719.47 μs 6.00 - -

FixedSizeTest

Method Mean Ratio Payload Allocated
NinoDeserializeFixedClass 4.83 ns 1.00 - 56 B
MemoryPackDeserializeFixedClass 10.61 ns 2.20 - 56 B
MessagePackDeserializeFixedClass 81.74 ns 16.92 - 50 B
ProtobufDeserializeFixedClass 135.99 ns 28.16 - 56 B
NinoSerializeFixedClass 4.86 ns 1.00 41 B 72 B
MemoryPackSerializeFixedClass 12.71 ns 2.62 41 B 72 B
MessagePackSerializeFixedClass 61.22 ns 12.62 69 B 88 B
ProtobufSerializeFixedClass 136.18 ns 28.07 53 B 80 B
NinoDeserializeFixedClasses 692.04 ns 1.01 - 6424 B
MemoryPackDeserializeFixedClasses 993.86 ns 1.45 - 6424 B
MessagePackDeserializeFixedClasses 13.80 μs 20.06 - -
ProtobufDeserializeFixedClasses 10.14 μs 14.75 - 6424 B
NinoSerializeFixedClasses 281.18 ns 1.00 4,104 B 4128 B
MemoryPackSerializeFixedClasses 996.10 ns 3.55 4,104 B 4128 B
MessagePackSerializeFixedClasses 4.91 μs 17.50 6,903 B 6928 B
ProtobufSerializeFixedClasses 10.14 μs 36.09 5,488 B -
NinoDeserializeFixedStruct 0.05 ns ? - -
MemoryPackDeserializeFixedStruct 0.25 ns ? - -
MessagePackDeserializeFixedStruct 92.06 ns ? - -
ProtobufDeserializeFixedStruct 138.01 ns ? - -
NinoSerializeFixedStruct 5.08 ns 1.00 40 B 64 B
MemoryPackSerializeFixedStruct 5.02 ns 0.99 40 B 64 B
MessagePackSerializeFixedStruct 62.92 ns 12.39 69 B 96 B
ProtobufSerializeFixedStruct 126.10 ns 24.83 53 B -

PooledGraphTest

Method Mean Ratio Payload Allocated
NinoLeavesNew 1.76 μs 1.00 - 13656 B
NinoLeavesPooledElements 1.46 μs 0.83 - -
NinoLeavesInPlace 273.22 ns 0.16 - -
MemoryPackLeavesNew 2.16 μs 1.23 - 13656 B
MessagePackLeavesNew 5.52 μs 3.13 - 13656 B
ProtobufLeavesNew 16.32 μs 9.26 - -
MemoryPackLeavesOverwrite 2.59 μs 1.47 - 12800 B
NinoNodeNew 282.27 ns 1.00 - 2192 B
NinoNodePooled 75.27 ns 0.27 - -
MemoryPackNodeNew 316.05 ns 1.12 - 2192 B
MessagePackNodeNew 922.48 ns 3.27 - -
ProtobufNodeNew 3.03 μs 10.76 - -
MemoryPackNodeOverwrite 259.12 ns 0.92 - 1024 B
NinoPlainNew 1.52 μs 1.00 - 12856 B
MemoryPackPlainNew 2.07 μs 1.36 - 12856 B
MessagePackPlainNew 5.48 μs 3.61 - 12856 B
ProtobufPlainNew 15.66 μs 10.30 - -

BclTypesTest

Method Mean Ratio Payload Allocated
NinoDeserializeBigInteger 32.21 ns 1.00 - 256 B
MessagePackDeserializeBigInteger 67.24 ns 2.09 - 256 B
NinoSerializeBigInteger 8.37 ns 1.00 203 B -
MessagePackSerializeBigInteger 25.73 ns 3.08 201 B -
NinoDeserializeBitArray 36.29 ns 1.00 - 336 B
MessagePackDeserializeBitArray 2.37 μs 65.42 - 184 B
NinoSerializeBitArray 14.69 ns 1.00 129 B -
MessagePackSerializeBitArray 1.95 μs 132.57 1,003 B -
NinoDeserializeCultureInfo 14.39 ns 1.00 - 32 B
MemoryPackDeserializeCultureInfo 35.69 ns 2.48 - 64 B
NinoSerializeCultureInfo 2.69 ns 1.00 6 B -
MemoryPackSerializeCultureInfo 14.18 ns 5.27 13 B -
NinoDeserializeTimeZoneInfo 7.30 ns 1.00 - 32 B
MemoryPackDeserializeTimeZoneInfo 166.42 ns 22.81 - 680 B
NinoSerializeTimeZoneInfo 3.38 ns 1.00 5 B -
MemoryPackSerializeTimeZoneInfo 98.96 ns 29.31 102 B 216 B
NinoDeserializeBlockingCollection 5.12 μs 1.00 - 12792 B
MemoryPackDeserializeBlockingCollection 28.98 μs 5.66 - -
NinoSerializeBlockingCollection 5.37 μs 1.00 4,004 B 4096 B
MemoryPackSerializeBlockingCollection 11.74 μs 2.19 4,004 B 72 B
NinoDeserializeImmutableDictionary 20.49 μs 1.00 - 68088 B
MemoryPackDeserializeImmutableDictionary 112.76 μs 5.50 - -
MessagePackDeserializeImmutableDictionary 119.97 μs 5.85 - 56096 B
ProtobufDeserializeImmutableDictionary 164.77 μs 8.04 - 56080 B
NinoSerializeImmutableDictionary 3.37 μs 1.00 8,004 B -
MemoryPackSerializeImmutableDictionary 21.05 μs 6.24 8,004 B -
MessagePackSerializeImmutableDictionary 26.69 μs 7.91 5,563 B -
ProtobufSerializeImmutableDictionary 75.34 μs 22.33 7,849 B 208 B
NinoDeserializeImmutableHashSet 19.74 μs 1.00 - 64096 B
MemoryPackDeserializeImmutableHashSet 105.11 μs 5.33 - 56104 B
MessagePackDeserializeImmutableHashSet 108.76 μs 5.51 - 56104 B
ProtobufDeserializeImmutableHashSet 113.80 μs 5.77 - -
NinoSerializeImmutableHashSet 3.22 μs 1.00 4,004 B -
MemoryPackSerializeImmutableHashSet 21.89 μs 6.84 4,004 B -
MessagePackSerializeImmutableHashSet 18.73 μs 5.85 2,619 B -
ProtobufSerializeImmutableHashSet 43.76 μs 13.66 2,872 B 168 B
NinoDeserializeImmutableQueue 7.59 μs 1.00 - 36064 B
MemoryPackDeserializeImmutableQueue 9.25 μs 1.22 - 32112 B
MessagePackDeserializeImmutableQueue 22.01 μs 2.90 - 72024 B
ProtobufDeserializeImmutableQueue 33.94 μs 4.47 - 72000 B
NinoSerializeImmutableQueue 1.97 μs 1.00 4,004 B -
MemoryPackSerializeImmutableQueue 9.23 μs 4.68 4,004 B -
MessagePackSerializeImmutableQueue 6.70 μs 3.40 2,619 B 48 B
ProtobufSerializeImmutableQueue 14.59 μs 7.40 2,872 B -
NinoDeserializeImmutableSortedSet 12.63 μs 1.00 - 52056 B
MemoryPackDeserializeImmutableSortedSet 87.76 μs 6.95 - 48088 B
MessagePackDeserializeImmutableSortedSet 87.09 μs 6.89 - 48088 B
ProtobufDeserializeImmutableSortedSet 35.60 μs 2.82 - 313589 B
NinoSerializeImmutableSortedSet 2.83 μs 1.00 4,004 B -
MemoryPackSerializeImmutableSortedSet 13.92 μs 4.92 4,004 B -
MessagePackSerializeImmutableSortedSet 10.83 μs 3.82 2,619 B -
ProtobufSerializeImmutableSortedSet 24.61 μs 8.69 2,872 B 168 B
NinoDeserializeImmutableStack 7.42 μs 1.00 - 36024 B
MemoryPackDeserializeImmutableStack 9.62 μs 1.30 - 32040 B
MessagePackDeserializeImmutableStack 13.02 μs 1.75 - 36024 B
ProtobufDeserializeImmutableStack 24.98 μs 3.37 - 32000 B
NinoSerializeImmutableStack 2.87 μs 1.00 4,004 B -
MemoryPackSerializeImmutableStack 15.42 μs 5.38 4,004 B 4112 B
MessagePackSerializeImmutableStack 5.93 μs 2.07 2,619 B 40 B
ProtobufSerializeImmutableStack 15.45 μs 5.39 2,872 B -
NinoDeserializeImmutableSortedDictionary 12.85 μs 1.00 - 56072 B
MemoryPackDeserializeImmutableSortedDictionary 97.83 μs 7.61 - 48112 B
MessagePackDeserializeImmutableSortedDictionary 102.71 μs 7.99 - 48112 B
ProtobufDeserializeImmutableSortedDictionary 154.15 μs 11.99 - 104520 B
NinoSerializeImmutableSortedDictionary 3.09 μs 1.00 8,004 B -
MemoryPackSerializeImmutableSortedDictionary 9.30 μs 3.01 8,004 B -
MessagePackSerializeImmutableSortedDictionary 18.42 μs 5.97 5,563 B -
ProtobufSerializeImmutableSortedDictionary 62.43 μs 20.22 7,849 B 208 B
NinoDeserializeLazy 19.47 ns 1.00 - 112 B
MemoryPackDeserializeLazy 38.33 ns 1.97 - 112 B
MessagePackDeserializeLazy 107.90 ns 5.54 - 232 B
NinoSerializeLazy 7.37 ns 1.00 24 B -
MemoryPackSerializeLazy 45.54 ns 6.18 31 B -
MessagePackSerializeLazy 48.20 ns 6.54 23 B -
NinoDeserializeMemory 252.01 ns 1.00 - 4056 B
MemoryPackDeserializeMemory 312.62 ns 1.24 - 4056 B
MessagePackDeserializeMemory 4.57 μs 18.15 - 4056 B
NinoSerializeMemory 50.02 ns 1.00 4,004 B -
MemoryPackSerializeMemory 76.04 ns 1.52 4,004 B -
MessagePackSerializeMemory 3.59 μs 71.83 2,619 B -
NinoDeserializeReadOnlySequence 252.70 ns 1.00 - 4064 B
MemoryPackDeserializeReadOnlySequence 315.84 ns 1.25 - 4064 B
MessagePackDeserializeReadOnlySequence 4.11 μs 16.25 - 4064 B
NinoSerializeReadOnlySequence 52.74 ns 1.00 4,004 B -
MemoryPackSerializeReadOnlySequence 74.07 ns 1.40 4,004 B -
MessagePackSerializeReadOnlySequence 5.54 μs 105.10 2,619 B -
NinoDeserializeStringBuilder 141.12 ns 1.00 - 2072 B
MemoryPackDeserializeStringBuilder 155.60 ns 1.10 - 2072 B
MessagePackDeserializeStringBuilder 368.05 ns 2.61 - 4096 B
NinoSerializeStringBuilder 31.65 ns 1.00 2,003 B -
MemoryPackSerializeStringBuilder 54.75 ns 1.73 2,004 B -
MessagePackSerializeStringBuilder 235.65 ns 7.45 1,003 B 2024 B
NinoDeserializeUri 105.43 ns 1.00 - 184 B
MemoryPackDeserializeUri 119.80 ns 1.14 - 184 B
MessagePackDeserializeUri 159.22 ns 1.51 - -
ProtobufDeserializeUri 259.78 ns 2.46 - 184 B
NinoSerializeUri 8.06 ns 1.00 53 B -
MemoryPackSerializeUri 28.57 ns 3.55 60 B -
MessagePackSerializeUri 42.94 ns 5.33 54 B -
ProtobufSerializeUri 107.42 ns 13.33 54 B -
NinoDeserializeVersion 7.24 ns 1.00 - 32 B
MemoryPackDeserializeVersion 18.36 ns 2.55 - 32 B
MessagePackDeserializeVersion 113.64 ns 15.76 - -
NinoSerializeVersion 4.99 ns 1.00 16 B -
MemoryPackSerializeVersion 22.69 ns 4.56 17 B -
MessagePackSerializeVersion 71.48 ns 14.35 8 B 40 B
NinoDeserializeLookup 566.68 ns 1.00 - 5152 B
MemoryPackDeserializeLookup 814.45 ns 1.44 - 5576 B
MessagePackDeserializeLookup 5.97 μs 10.56 - -
NinoSerializeLookup 2.62 μs 1.00 4,084 B 320 B
MemoryPackSerializeLookup 9.46 μs 3.62 4,094 B 320 B
MessagePackSerializeLookup 4.59 μs 1.75 2,667 B 368 B
NinoDeserializeReadOnlyCollection 256.28 ns 1.00 - 4048 B
MemoryPackDeserializeReadOnlyCollection 312.99 ns 1.22 - 4048 B
MessagePackDeserializeReadOnlyCollection 5.35 μs 20.88 - -
NinoSerializeReadOnlyCollection 2.33 μs 1.00 4,004 B 40 B
MemoryPackSerializeReadOnlyCollection 8.51 μs 3.65 4,004 B 40 B
MessagePackSerializeReadOnlyCollection 5.07 μs 2.17 2,619 B 40 B

GenericPolymorphicTest

Method Mean Ratio Payload Allocated
NinoDeserializeGenericIntBase 10.32 μs 1.00 - 32024 B
MemoryPackDeserializeGenericIntBase 34.18 μs 3.31 - 32024 B
ProtobufDeserializeGenericIntBase 139.17 μs 13.48 - 32030 B
NinoSerializeGenericIntBase 2.41 μs 1.00 8,004 B -
MemoryPackSerializeGenericIntBase 40.94 μs 16.97 6,004 B -
ProtobufSerializeGenericIntBase 82.61 μs 34.25 5,967 B -
NinoDeserializeGenericManagedTupleBase 24.73 μs 1.00 - 72024 B
MemoryPackDeserializeGenericManagedTupleBase 54.18 μs 2.19 - 72024 B
ProtobufDeserializeGenericManagedTupleBase 202.42 μs 8.19 - 72037 B
NinoSerializeGenericManagedTupleBase 6.55 μs 1.00 14,004 B -
MemoryPackSerializeGenericManagedTupleBase 70.05 μs 10.70 19,004 B -
ProtobufSerializeGenericManagedTupleBase 136.01 μs 20.78 15,253 B -
NinoDeserializeGenericOpenClassTupleBase 21.76 μs 1.00 - 72024 B
MemoryPackDeserializeGenericOpenClassTupleBase 50.33 μs 2.31 - 72024 B
ProtobufDeserializeGenericOpenClassTupleBase 240.24 μs 11.04 - 72037 B
NinoSerializeGenericOpenClassTupleBase 5.85 μs 1.00 24,004 B -
MemoryPackSerializeGenericOpenClassTupleBase 72.36 μs 12.39 19,004 B -
ProtobufSerializeGenericOpenClassTupleBase 169.65 μs 29.06 13,681 B -
NinoDeserializeGenericSealedClassTupleBase 21.93 μs 1.00 - 72024 B
MemoryPackDeserializeGenericSealedClassTupleBase 49.96 μs 2.28 - 72024 B
ProtobufDeserializeGenericSealedClassTupleBase 246.67 μs 11.25 - 72038 B
NinoSerializeGenericSealedClassTupleBase 5.68 μs 1.00 21,004 B -
MemoryPackSerializeGenericSealedClassTupleBase 71.49 μs 12.60 19,004 B -
ProtobufSerializeGenericSealedClassTupleBase 186.66 μs 32.89 13,681 B -
NinoDeserializeGenericUnmanagedTupleBase 12.08 μs 1.00 - 40024 B
MemoryPackDeserializeGenericUnmanagedTupleBase 36.47 μs 3.02 - 40024 B
ProtobufDeserializeGenericUnmanagedTupleBase 175.32 μs 14.52 - 40031 B
NinoSerializeGenericUnmanagedTupleBase 3.67 μs 1.00 16,004 B -
MemoryPackSerializeGenericUnmanagedTupleBase 41.88 μs 11.42 18,004 B -
ProtobufSerializeGenericUnmanagedTupleBase 116.31 μs 31.73 10,253 B -
NinoDeserializeNonGenericBase 10.13 μs 1.00 - 32024 B
MemoryPackDeserializeNonGenericBase 21.63 μs 2.14 - -
MessagePackDeserializeNonGenericBase 51.63 μs 5.10 - 32024 B
ProtobufDeserializeNonGenericBase 139.11 μs 13.74 - 32030 B
NinoSerializeNonGenericBase 2.50 μs 1.00 8,004 B -
MemoryPackSerializeNonGenericBase 28.58 μs 11.45 6,004 B -
MessagePackSerializeNonGenericBase 32.81 μs 13.15 4,003 B -
ProtobufSerializeNonGenericBase 90.49 μs 36.26 5,967 B -

CommonTypesTest

Method Mean Ratio Payload Allocated
NinoDeserializeOrders 12.82 μs 1.00 - 88552 B
MemoryPackDeserializeOrders 16.53 μs 1.29 - 88552 B
MessagePackDeserializeOrders 65.66 μs 5.13 - 88552 B
ProtobufDeserializeOrders 67.50 μs 5.27 - 98986 B
NinoSerializeOrders 3.05 μs 1.00 23,726 B -
MemoryPackSerializeOrders 8.27 μs 2.71 27,990 B -
MessagePackSerializeOrders 29.56 μs 9.70 15,332 B -
ProtobufSerializeOrders 49.08 μs 16.11 15,843 B 4000 B
NinoDeserializePlayers 17.72 μs 1.00 - 120056 B
MemoryPackDeserializePlayers 21.86 μs 1.23 - 120056 B
MessagePackDeserializePlayers 65.04 μs 3.67 - 120056 B
ProtobufDeserializePlayers 145.51 μs 8.21 - 140088 B
NinoSerializePlayers 4.10 μs 1.00 36,164 B -
MemoryPackSerializePlayers 14.31 μs 3.49 43,364 B -
MessagePackSerializePlayers 31.62 μs 7.71 25,563 B -
ProtobufSerializePlayers 86.32 μs 21.06 33,579 B 4000 B
NinoDeserializeInventory 178.09 ns 1.00 - 8024 B
MemoryPackDeserializeInventory 198.57 ns 1.12 - 8024 B
MessagePackDeserializeInventory 11.77 μs 66.11 - 8024 B
ProtobufDeserializeInventory 26.92 μs 151.16 - 46591 B
NinoSerializeInventory 38.27 ns 1.00 8,004 B -
MemoryPackSerializeInventory 40.10 ns 1.05 8,004 B -
MessagePackSerializeInventory 4.48 μs 117.06 5,619 B -
ProtobufSerializeInventory 25.43 μs 664.54 7,518 B -
NinoDeserializeShapes 6.15 μs 1.00 - 36056 B
MemoryPackDeserializeShapes 8.47 μs 1.38 - 36056 B
MessagePackDeserializeShapes 30.01 μs 4.88 - -
ProtobufDeserializeShapes 97.85 μs 15.92 - 36089 B
NinoSerializeShapes 962.91 ns 1.00 14,004 B -
MemoryPackSerializeShapes 10.89 μs 11.34 12,004 B -
MessagePackSerializeShapes 18.65 μs 19.42 13,119 B -
ProtobufSerializeShapes 63.96 μs 66.59 15,365 B -
NinoDeserializeStringDictionary 17.06 μs 1.00 - 110216 B
MemoryPackDeserializeStringDictionary 29.80 μs 1.75 - 110216 B
MessagePackDeserializeStringDictionary 36.43 μs 2.14 - 110216 B
ProtobufDeserializeStringDictionary 69.89 μs 4.10 - 181416 B
NinoSerializeStringDictionary 4.47 μs 1.00 16,734 B -
MemoryPackSerializeStringDictionary 23.40 μs 5.23 30,734 B -
MessagePackSerializeStringDictionary 15.01 μs 3.36 16,733 B -
ProtobufSerializeStringDictionary 35.84 μs 8.01 20,730 B 40 B
NinoDeserializeTree 26.49 μs 1.00 - 171872 B
MemoryPackDeserializeTree 33.00 μs 1.25 - 171872 B
MessagePackDeserializeTree 76.80 μs 2.90 - 171872 B
NinoSerializeTree 6.32 μs 1.00 27,163 B -
MemoryPackSerializeTree 10.98 μs 1.74 32,623 B -
MessagePackSerializeTree 40.89 μs 6.47 20,338 B -
NinoDeserializeWaypoints 501.64 ns 1.00 - 24024 B
MemoryPackDeserializeWaypoints 592.80 ns 1.18 - 24024 B
MessagePackDeserializeWaypoints 35.16 μs 70.12 - -
ProtobufDeserializeWaypoints 59.57 μs 118.79 - 24024 B
NinoSerializeWaypoints 149.80 ns 1.00 15,004 B -
MemoryPackSerializeWaypoints 134.29 ns 0.90 24,004 B -
MessagePackSerializeWaypoints 20.41 μs 136.25 16,979 B -
ProtobufSerializeWaypoints 57.39 μs 383.09 19,482 B -

PolymorphicTest

Method Mean Ratio Payload Allocated
NinoDeserializePolymorphicClassArray 116.93 μs 1.00 - 745624 B
MemoryPackDeserializePolymorphicClassArray 194.81 μs 1.67 - 745624 B
MessagePackDeserializePolymorphicClassArray 891.26 μs 7.63 - 1162424 B
ProtobufDeserializePolymorphicClassArray 3.18 ms 27.23 - 1211477 B
NinoSerializePolymorphicClassArray 26.99 μs 1.00 397,304 B -
MemoryPackSerializePolymorphicClassArray 195.54 μs 7.25 384,404 B -
MessagePackSerializePolymorphicClassArray 529.74 μs 19.63 487,103 B -
ProtobufSerializePolymorphicClassArray 2.47 ms 91.67 635,807 B 8000 B
NinoDeserializePolymorphicClass 9.16 μs 1.00 - 79688 B
MemoryPackDeserializePolymorphicClass 16.49 μs 1.80 - 79688 B
MessagePackDeserializePolymorphicClass 118.22 μs 12.93 - 83856 B
ProtobufDeserializePolymorphicClass 483.05 μs 52.84 - 84376 B
NinoSerializePolymorphicClass 3.30 μs 1.00 53,789 B -
MemoryPackSerializePolymorphicClass 16.08 μs 4.88 51,760 B -
MessagePackSerializePolymorphicClass 74.96 μs 22.74 66,859 B -
ProtobufSerializePolymorphicClass 402.66 μs 122.16 91,495 B 80 B
NinoDeserializePolymorphicFooArray 8.52 μs 1.00 - 76024 B
MemoryPackDeserializePolymorphicFooArray 15.44 μs 1.81 - 76024 B
MessagePackDeserializePolymorphicFooArray 118.47 μs 13.91 - -
ProtobufDeserializePolymorphicFooArray 487.49 μs 57.25 - -
NinoSerializePolymorphicFooArray 3.74 μs 1.00 52,404 B -
MemoryPackSerializePolymorphicFooArray 15.75 μs 4.21 50,404 B -
MessagePackSerializePolymorphicFooArray 75.98 μs 20.31 65,203 B -
ProtobufSerializePolymorphicFooArray 395.18 μs 105.61 89,500 B -

UntrustedTest

Method Mean Ratio Payload Allocated
NinoDeserializeUntrustedList 1.04 μs 1.00 - 24056 B
MemoryPackDeserializeUntrustedList 715.24 ns 0.69 - 24056 B

VersionTolerantTest

Method Mean Ratio Payload Allocated
NinoDeserializeTolerantClass 348.54 ns 1.00 - 2288 B
MemoryPackDeserializeTolerantClass 768.72 ns 2.21 - 2528 B
MessagePackDeserializeTolerantClass 1.83 μs 5.24 - 2528 B
ProtobufDeserializeTolerantClass 6.01 μs 17.25 - 3536 B
NinoSerializeTolerantClass 99.69 ns 1.00 1,073 B -
MemoryPackSerializeTolerantClass 524.94 ns 5.27 1,164 B -
MessagePackSerializeTolerantClass 1.11 μs 11.18 1,068 B -
ProtobufSerializeTolerantClass 3.53 μs 35.40 1,253 B -
NinoDeserializeTolerantClasses 37.30 μs 1.00 - 229624 B
MemoryPackDeserializeTolerantClasses 77.63 μs 2.08 - 253624 B
MessagePackDeserializeTolerantClasses 188.04 μs 5.04 - 253624 B
ProtobufDeserializeTolerantClasses 581.00 μs 15.58 - -
NinoSerializeTolerantClasses 10.72 μs 1.00 107,304 B -
MemoryPackSerializeTolerantClasses 50.17 μs 4.68 116,404 B -
MessagePackSerializeTolerantClasses 113.41 μs 10.58 106,801 B -
ProtobufSerializeTolerantClasses 368.08 μs 34.33 124,968 B 8000 B

CollectionsTest

Method Mean Ratio Payload Allocated
NinoDeserializeHashSet 2.49 μs 1.00 - 17768 B
MemoryPackDeserializeHashSet 6.59 μs 2.65 - 17768 B
MessagePackDeserializeHashSet 15.70 μs 6.31 - 58664 B
ProtobufDeserializeHashSet 32.20 μs 12.94 - 58738 B
NinoSerializeHashSet 147.15 ns 1.00 4,004 B -
MemoryPackSerializeHashSet 8.46 μs 57.49 4,004 B -
MessagePackSerializeHashSet 5.67 μs 38.52 2,874 B -
ProtobufSerializeHashSet 16.60 μs 112.83 2,957 B 40 B
NinoDeserializeIntDictionary 3.39 μs 1.00 - 22192 B
MemoryPackDeserializeIntDictionary 9.25 μs 2.73 - 22192 B
MessagePackDeserializeIntDictionary 14.62 μs 4.32 - -
ProtobufDeserializeIntDictionary 73.17 μs 21.65 - 73168 B
NinoSerializeIntDictionary 228.88 ns 1.01 8,004 B -
MemoryPackSerializeIntDictionary 3.16 μs 13.90 8,004 B -
MessagePackSerializeIntDictionary 8.29 μs 36.47 5,818 B -
ProtobufSerializeIntDictionary 47.04 μs 207.01 7,934 B 40 B
NinoDeserializeKeyValuePairs 442.96 ns 1.00 - 8024 B
MemoryPackDeserializeKeyValuePairs 478.14 ns 1.08 - 8024 B
MessagePackDeserializeKeyValuePairs 32.23 μs 72.82 - 8024 B
ProtobufDeserializeKeyValuePairs 50.98 μs 115.16 - 8024 B
NinoSerializeKeyValuePairs 89.32 ns 1.00 8,004 B -
MemoryPackSerializeKeyValuePairs 92.39 ns 1.03 8,004 B -
MessagePackSerializeKeyValuePairs 20.43 μs 228.81 6,563 B -
ProtobufSerializeKeyValuePairs 49.16 μs 550.51 7,853 B -
NinoDeserializeQueue 257.25 ns 1.00 - 4064 B
MemoryPackDeserializeQueue 3.55 μs 13.82 - 4064 B
MessagePackDeserializeQueue 7.58 μs 29.49 - 4064 B
ProtobufDeserializeQueue 20.85 μs 81.07 - -
NinoSerializeQueue 49.39 ns 1.00 4,004 B -
MemoryPackSerializeQueue 13.06 μs 264.38 4,004 B -
MessagePackSerializeQueue 5.48 μs 111.03 2,619 B -
ProtobufSerializeQueue 13.43 μs 271.92 2,872 B -
NinoDeserializeTupleList 1.04 μs 1.00 - 16056 B
MemoryPackDeserializeTupleList 1.11 μs 1.07 - 16056 B
MessagePackDeserializeTupleList 31.55 μs 30.43 - 16057 B
ProtobufDeserializeTupleList 49.73 μs 47.96 - 16088 B
NinoSerializeTupleList 220.82 ns 1.01 12,004 B -
MemoryPackSerializeTupleList 219.32 ns 1.00 16,004 B -
MessagePackSerializeTupleList 22.60 μs 102.98 6,605 B -
ProtobufSerializeTupleList 52.10 μs 237.37 8,338 B -
NinoDeserializeConcurrentDictionary 10.56 μs 1.00 - 49112 B
MemoryPackDeserializeConcurrentDictionary 44.66 μs 4.23 - 141032 B
MessagePackDeserializeConcurrentDictionary 50.52 μs 4.79 - 141032 B
ProtobufDeserializeConcurrentDictionary 92.58 μs 8.77 - 141035 B
NinoSerializeConcurrentDictionary 1.75 μs 1.00 8,004 B -
MemoryPackSerializeConcurrentDictionary 3.22 μs 1.84 8,004 B -
MessagePackSerializeConcurrentDictionary 8.81 μs 5.03 5,563 B 56 B
ProtobufSerializeConcurrentDictionary 36.14 μs 20.64 7,849 B 96 B
NinoDeserializeLinkedList 9.28 μs 1.00 - 48040 B
MemoryPackDeserializeLinkedList 11.89 μs 1.28 - 48040 B
MessagePackDeserializeLinkedList 15.06 μs 1.62 - 48040 B
ProtobufDeserializeLinkedList 26.44 μs 2.85 - 48041 B
NinoSerializeLinkedList 1.42 μs 1.00 4,004 B -
MemoryPackSerializeLinkedList 6.25 μs 4.41 4,004 B -
MessagePackSerializeLinkedList 3.03 μs 2.14 2,619 B -
ProtobufSerializeLinkedList 13.36 μs 9.44 2,872 B 48 B
NinoDeserializeSelfTree 80.61 μs 1.00 - 251192 B
MemoryPackDeserializeSelfTree 123.52 μs 1.53 - 251196 B
NinoSerializeSelfTree 22.01 μs 1.00 21,844 B -
MemoryPackSerializeSelfTree 86.82 μs 3.94 21,844 B -
NinoDeserializeSortedDictionary 11.92 μs 1.00 - 48112 B
MemoryPackDeserializeSortedDictionary 35.55 μs 2.98 - 48112 B
MessagePackDeserializeSortedDictionary 43.52 μs 3.65 - 40689 B
ProtobufDeserializeSortedDictionary 104.49 μs 8.77 - -
NinoSerializeSortedDictionary 2.56 μs 1.00 8,004 B -
MemoryPackSerializeSortedDictionary 5.41 μs 2.12 8,004 B 200 B
MessagePackSerializeSortedDictionary 11.15 μs 4.37 5,563 B 200 B
ProtobufSerializeSortedDictionary 40.38 μs 15.81 7,849 B 288 B
NinoDeserializeSortedList 1.63 μs 1.00 - 8112 B
MemoryPackDeserializeSortedList 13.06 μs 8.01 - 8112 B
MessagePackDeserializeSortedList 19.23 μs 11.80 - 8112 B
ProtobufDeserializeSortedList 62.41 μs 38.30 - -
NinoSerializeSortedList 1.65 μs 1.00 8,004 B -
MemoryPackSerializeSortedList 2.85 μs 1.73 8,004 B -
MessagePackSerializeSortedList 7.51 μs 4.56 5,563 B 48 B
ProtobufSerializeSortedList 35.88 μs 21.78 7,849 B 88 B
NinoDeserializeSortedSet 11.33 μs 1.00 - 40048 B
MemoryPackDeserializeSortedSet 34.45 μs 3.04 - 40048 B
MessagePackDeserializeSortedSet 33.04 μs 2.92 - 40049 B
ProtobufDeserializeSortedSet 45.43 μs 4.02 - 40049 B
NinoSerializeSortedSet 2.11 μs 1.00 4,004 B -
MemoryPackSerializeSortedSet 9.31 μs 4.42 4,004 B 200 B
MessagePackSerializeSortedSet 9.57 μs 4.54 2,947 B 248 B
ProtobufSerializeSortedSet 16.88 μs 8.01 2,981 B 248 B

The cases ran in parallel on several runners (every serializer's run of a case on one):

  • PooledTest, ReferenceTest, ScatteredTest, SimpleTest: Intel Xeon 6973P-C 3.54GHz, 1 CPU, 4 logical and 2 physical cores
  • FixedSizeTest, PooledGraphTest: AMD EPYC 9V45 4.16GHz, 1 CPU, 4 logical and 2 physical cores
  • BclTypesTest, GenericPolymorphicTest: INTEL XEON PLATINUM 8573C 3.58GHz, 1 CPU, 4 logical and 2 physical cores
  • CommonTypesTest, PolymorphicTest, ScatteredTest: AMD EPYC 9V45 4.24GHz, 1 CPU, 4 logical and 2 physical cores
  • BclTypesTest, CommonTypesTest, ScatteredTest, UntrustedTest: AMD EPYC 9V45 4.49GHz, 1 CPU, 4 logical and 2 physical cores
  • BclTypesTest (NinoDeserializeBlockingCollection to ProtobufSerializeImmutableStack): AMD EPYC 7763 3.10GHz, 1 CPU, 4 logical and 2 physical cores
  • BclTypesTest (NinoDeserializeImmutableSortedDictionary to MessagePackSerializeVersion): AMD EPYC 7763 3.19GHz, 1 CPU, 4 logical and 2 physical cores
  • SimpleTest, VersionTolerantTest: AMD EPYC 7763 2.59GHz, 1 CPU, 4 logical and 2 physical cores
  • BclTypesTest, CollectionsTest: AMD EPYC 7763 2.58GHz, 1 CPU, 4 logical and 2 physical cores
  • CollectionsTest (NinoDeserializeConcurrentDictionary to ProtobufSerializeSortedSet): AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores

Median, Min, Max and the GC counts: benchmark-x64-full.md.


Benchmark generated automatically on 2026-11-08 05:37:32 UTC

🌐 TypeScript runtime benchmark

Generated TypeScript of v4.0.0-rc.9 against Protocol Buffers, MessagePack and JSON, in Node

The code nino-gen generates for runtimes/typescript/bench (Program.cs's types), against Protocol Buffers (protobuf-es), MessagePack (msgpackr) and JSON (to and from UTF-8 bytes), in Node v27.0.0-alpha.0.0.0, on data .NET wrote, timed by tinybench 6.2.2: the mean time of a pass over each scenario's values (each pass the next of 64 variants, so that no pass reads what the one before read), ± its relative margin of error, and passes per second.

Scenario Operation Nino Protobuf MessagePack JSON
Player x1000 serialize 131.62 μs ±0.5% (7,597/s) 1.96 ms ±5% (511/s) 1.20 ms ±0.8% (832/s) 1.18 ms ±5% (850/s)
Player x1000 serializeInto 122.39 μs ±0.8% (8,170/s)
Player x1000 deserialize 620.33 μs ±3% (1,612/s) 1.96 ms ±7% (510/s) 882.49 μs ±0.3% (1,133/s) 1.08 ms ±0.8% (929/s)
Player x1000 size 118.3 KiB 100.2 KiB 187.9 KiB 285.5 KiB
Zoo 50 x 100 animals (type ids) serialize 96.92 μs ±0.4% (10,318/s) 828.79 μs ±2% (1,207/s) 1.12 ms ±1% (897/s) 276.15 μs ±1% (3,621/s)
Zoo 50 x 100 animals (type ids) serializeInto 88.60 μs ±0.1% (11,286/s)
Zoo 50 x 100 animals (type ids) deserialize 89.87 μs ±0.3% (11,127/s) 1.83 ms ±8% (545/s) 590.71 μs ±0.4% (1,693/s) 863.31 μs ±1% (1,158/s)
Zoo 50 x 100 animals (type ids) size 71.4 KiB 71.3 KiB 117.5 KiB 161.2 KiB
OrderBook 100 x 50 orders serialize 276.77 μs ±0.4% (3,613/s) 1.59 ms ±3% (631/s) 1.91 ms ±2% (524/s) 745.05 μs ±0.6% (1,342/s)
OrderBook 100 x 50 orders serializeInto 242.98 μs ±0.2% (4,116/s)
OrderBook 100 x 50 orders deserialize 292.19 μs ±1% (3,422/s) 2.62 ms ±5% (381/s) 1.50 ms ±0.7% (665/s) 857.79 μs ±0.3% (1,166/s)
OrderBook 100 x 50 orders size 225.1 KiB 235.9 KiB 433.9 KiB 551.3 KiB
Article x200 (text) serialize 142.91 μs ±1% (6,997/s) 1.07 ms ±4% (933/s) 240.94 μs ±0.4% (4,150/s) 547.54 μs ±2% (1,826/s)
Article x200 (text) serializeInto 81.39 μs ±0.2% (12,286/s)
Article x200 (text) deserialize 135.58 μs ±0.4% (7,376/s) 462.37 μs ±5% (2,163/s) 291.64 μs ±0.7% (3,429/s) 412.00 μs ±0.6% (2,427/s)
Article x200 (text) size 430.2 KiB 421.6 KiB 428.2 KiB 434.2 KiB
Mesh 20 x (2 x 500 Vec3, 1500 int) serialize 181.67 μs ±0.7% (5,504/s) 2.11 ms ±0.9% (474/s) 4.22 ms ±0.6% (237/s) 2.66 ms ±0.4% (377/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) serializeInto 153.27 μs ±0.2% (6,524/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) deserialize 209.61 μs ±6% (4,771/s) 4.49 ms ±7% (223/s) 1.99 ms ±1% (503/s) 2.83 ms ±0.3% (354/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) size 351.9 KiB 383.3 KiB 769.5 KiB 1514.3 KiB
Samples 20 x (3 x 1000 numbers) serialize 88.86 μs ±2% (11,254/s) 699.80 μs ±2% (1,429/s) 548.52 μs ±0.4% (1,823/s) 1.38 ms ±0.3% (726/s)
Samples 20 x (3 x 1000 numbers) serializeInto 53.51 μs ±0.4% (18,689/s)
Samples 20 x (3 x 1000 numbers) deserialize 69.30 μs ±2% (14,430/s) 1.14 ms ±22% (879/s) 648.55 μs ±2% (1,542/s) 1.19 ms ±0.3% (838/s)
Samples 20 x (3 x 1000 numbers) size 312.8 KiB 293.0 KiB 448.0 KiB 876.1 KiB
Lookup 50 x (2 maps of 100) serialize 173.72 μs ±0.4% (5,756/s) 1.23 ms ±4% (813/s) 378.13 μs ±0.6% (2,645/s) 880.11 μs ±2% (1,136/s)
Lookup 50 x (2 maps of 100) serializeInto 165.26 μs ±0.2% (6,051/s)
Lookup 50 x (2 maps of 100) deserialize 618.84 μs ±1.0% (1,616/s) 2.62 ms ±5% (382/s) 1.28 ms ±3% (781/s) 4.02 ms ±10% (249/s)
Lookup 50 x (2 maps of 100) size 156.2 KiB 178.4 KiB 147.7 KiB 194.5 KiB
Event x1000 (long) serialize 41.22 μs ±0.7% (24,263/s) 881.33 μs ±4% (1,135/s) 411.24 μs ±1% (2,432/s) 1.13 ms ±4% (884/s)
Event x1000 (long) serializeInto 20.22 μs ±0.3% (49,463/s)
Event x1000 (long) deserialize 43.42 μs ±0.7% (23,033/s) 559.73 μs ±8% (1,787/s) 139.15 μs ±0.4% (7,187/s) 489.19 μs ±1% (2,044/s)
Event x1000 (long) size 55.7 KiB 50.6 KiB 77.1 KiB 151.9 KiB
Strings 1000 (ASCII) serialize 13.73 μs ±0.4% (72,845/s) 28.61 μs ±0.6% (34,952/s) 21.96 μs ±0.2% (45,536/s) 7.80 μs ±0.3% (128,187/s)
Strings 1000 (ASCII) serializeInto 12.96 μs ±0.2% (77,135/s)
Strings 1000 (ASCII) deserialize 11.60 μs ±0.4% (86,212/s) 71.41 μs ±6% (14,003/s) 14.29 μs ±0.3% (69,986/s) 17.38 μs ±0.4% (57,532/s)
Strings 1000 (ASCII) size 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB
Strings 1000 (ASCII, Latin-1, other) serialize 20.01 μs ±0.5% (49,980/s) 65.60 μs ±0.2% (15,244/s) 36.11 μs ±0.2% (27,696/s) 17.55 μs ±0.2% (56,990/s)
Strings 1000 (ASCII, Latin-1, other) serializeInto 18.55 μs ±0.1% (53,911/s)
Strings 1000 (ASCII, Latin-1, other) deserialize 22.34 μs ±0.3% (44,754/s) 134.97 μs ±0.3% (7,409/s) 100.90 μs ±0.1% (9,910/s) 27.49 μs ±0.3% (36,380/s)
Strings 1000 (ASCII, Latin-1, other) size 20.4 KiB 21.4 KiB 20.4 KiB 22.4 KiB
IntSet 20 x 1000 serialize 49.19 μs ±0.7% (20,330/s) 362.20 μs ±1% (2,761/s) 186.76 μs ±0.3% (5,354/s) 389.62 μs ±0.3% (2,567/s)
IntSet 20 x 1000 serializeInto 40.18 μs ±0.1% (24,889/s)
IntSet 20 x 1000 deserialize 440.78 μs ±0.6% (2,269/s) 641.68 μs ±0.2% (1,558/s) 544.92 μs ±0.2% (1,835/s) 756.97 μs ±0.2% (1,321/s)
IntSet 20 x 1000 size 78.2 KiB 95.3 KiB 97.9 KiB 205.0 KiB
StringSet 20 x 1000 serialize 275.67 μs ±0.4% (3,628/s) 603.45 μs ±1% (1,657/s) 511.98 μs ±0.6% (1,953/s) 181.70 μs ±0.7% (5,504/s)
StringSet 20 x 1000 serializeInto 261.47 μs ±0.2% (3,825/s)
StringSet 20 x 1000 deserialize 3.03 ms ±3% (330/s) 4.27 ms ±3% (234/s) 3.44 ms ±4% (290/s) 3.35 ms ±3% (298/s)
StringSet 20 x 1000 size 212.8 KiB 232.2 KiB 212.9 KiB 252.0 KiB

🐹 Go runtime benchmark

The Go runtime of v4.0.0-rc.9 against Protocol Buffers, MessagePack, encoding/json and gob

runtimes/go/bench (testing.B, summarized by benchstat: medians ± their 95% confidence interval): codecs in the shape nino-gen generates (Nino) and the struct tags (NinoTags) against Protocol Buffers (google.golang.org/protobuf), MessagePack (vmihailenco/msgpack), encoding/json and gob, on AMD EPYC 9V74 80-Core Processor , linux/amd64. Allocations are counted per operation; sizes are the encoded bytes.

Case Operation Nino NinoTags Protobuf MessagePack JSON Gob
simple-class serialize 363.75 ns ±3% 724.35 ns ±1% 3.79 μs ±1% 4.84 μs ±4% 6.96 μs ±3% 6.77 μs ±3%
simple-class deserialize 903.60 ns ±0% 1.30 μs ±3% 4.86 μs ±2% 8.75 μs ±4% 12.24 μs ±0% 19.09 μs ±3%
simple-class serialize allocs 0 1 80 41 15 65
simple-class deserialize allocs 12 16 66 64 29 254
simple-class size 1.0 KiB 1.0 KiB 1.1 KiB 1.2 KiB 1.9 KiB 1.3 KiB
simple-class-100 serialize 36.95 μs ±1% 73.60 μs ±1% 390.03 μs ±2% 486.77 μs ±2% 739.04 μs ±1% 339.26 μs ±1%
simple-class-100 deserialize 95.58 μs ±1% 119.46 μs ±4% 491.99 μs ±3% 879.31 μs ±11% 1.30 ms ±0% 387.87 μs ±1%
simple-class-100 serialize allocs 0 101 8000 4101 1403 4042
simple-class-100 deserialize allocs 1204 1407 6609 6208 2839 2749
simple-class-100 size 104.4 KiB 104.4 KiB 111.4 KiB 122.9 KiB 193.1 KiB 107.1 KiB
scattered-1m serialize 169.38 ms ±4% 305.66 ms ±2% 422.01 ms ±3% 540.74 ms ±2% 683.72 ms ±9% 433.95 ms ±8%
scattered-1m deserialize 60.34 ms ±6% 112.18 ms ±2% 173.77 ms ±5% 362.40 ms ±29% 606.64 ms ±2% 181.55 ms ±5%
scattered-1m serialize allocs 0 1 0 1 18 64
scattered-1m deserialize allocs 1017237 1017240 3000039 3000010 3000044 3000187
scattered-1m size 48611.1 KiB 48611.1 KiB 52501.2 KiB 70095.5 KiB 92173.2 KiB 52879.2 KiB
int-set-1000 serialize 60.92 ns ±2% 113.20 ns ±1% 5.99 μs ±1% 23.58 μs ±2% 19.92 μs ±1% 11.16 μs ±6%
int-set-1000 deserialize 3.17 μs ±5% 1.03 μs ±3% 7.46 μs ±1% 37.95 μs ±2% 54.89 μs ±1% 16.63 μs ±1%
int-set-1000 serialize allocs 0 1 0 1 3 24
int-set-1000 deserialize allocs 2 5 2 8 13 154
int-set-1000 size 3.9 KiB 3.9 KiB 4.8 KiB 4.9 KiB 10.2 KiB 4.9 KiB
string-set-1000 serialize 2.15 μs ±4% 10.55 μs ±0% 12.61 μs ±5% 30.87 μs ±1% 41.72 μs ±0% 24.38 μs ±1%
string-set-1000 deserialize 26.17 μs ±0% 44.73 μs ±4% 36.13 μs ±11% 94.57 μs ±2% 107.82 μs ±0% 73.86 μs ±1%
string-set-1000 serialize allocs 0 1 0 1 3 27
string-set-1000 deserialize allocs 38 1010 1012 2008 2013 2154
string-set-1000 size 10.6 KiB 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB 10.7 KiB
strings-1000 serialize 1.93 μs ±2% 2.01 μs ±3% 11.99 μs ±2% 10.61 μs ±2% 29.72 μs ±1% 14.46 μs ±3%
strings-1000 deserialize 9.19 μs ±2% 9.27 μs ±1% 34.57 μs ±0% 35.56 μs ±3% 67.34 μs ±2% 34.39 μs ±4%
strings-1000 serialize allocs 0 1 0 1 3 27
strings-1000 deserialize allocs 7 9 1012 1004 1013 1153
strings-1000 size 10.6 KiB 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB 10.7 KiB
strings-mixed-1000 serialize 5.13 μs ±5% 5.09 μs ±3% 24.72 μs ±1% 11.08 μs ±1% 48.71 μs ±0% 21.25 μs ±2%
strings-mixed-1000 deserialize 21.24 μs ±1% 21.55 μs ±1% 48.38 μs ±1% 36.64 μs ±0% 108.48 μs ±0% 37.93 μs ±2%
strings-mixed-1000 serialize allocs 0 1 0 1 3 29
strings-mixed-1000 deserialize allocs 12 14 1012 1004 1013 1153
strings-mixed-1000 size 20.4 KiB 20.4 KiB 21.4 KiB 20.4 KiB 22.3 KiB 20.4 KiB
strings-mixed-utf8-1000 serialize 10.87 μs ±1%
strings-mixed-utf8-1000 deserialize 20.95 μs ±1%
strings-mixed-utf8-1000 serialize allocs 0
strings-mixed-utf8-1000 deserialize allocs 12
strings-mixed-utf8-1000 size 21.4 KiB

🦀 Rust runtime benchmark

The Rust runtime of v4.0.0-rc.9 against Protocol Buffers, MessagePack, bincode, postcard and serde_json

runtimes/rust/bench (criterion): codecs in the shape nino-gen generates against Protocol Buffers (prost), MessagePack (rmp-serde), bincode, postcard and serde_json. Times are criterion's mean estimates ± half their 95% confidence interval; sizes are the encoded bytes of each case.

Case Operation nino prost rmp-serde bincode postcard serde_json
f64-10000 serialize 1.64 μs ±0.2% 7.44 μs ±0.4% 29.86 μs ±0.3% 17.36 μs ±0.2% 19.46 μs ±1% 254.91 μs ±0.3%
f64-10000 deserialize 1.66 μs ±0.3% 16.47 μs ±0.6% 50.08 μs ±0.2% 16.92 μs ±0.5% 13.37 μs ±0.2% 173.56 μs ±0.2%
f64-10000 size 78.1 KiB 78.1 KiB 87.9 KiB 78.1 KiB 78.1 KiB 66.2 KiB
i32-10000 serialize 807.93 ns ±0.3% 90.60 μs ±0.6% 137.49 μs ±0.2% 39.53 μs ±0.5% 74.17 μs ±0.2% 81.90 μs ±0.6%
i32-10000 deserialize 842.81 ns ±0.3% 45.19 μs ±0.6% 47.94 μs ±0.7% 38.31 μs ±0.5% 26.83 μs ±0.2% 170.59 μs ±0.3%
i32-10000 size 39.1 KiB 38.8 KiB 48.8 KiB 48.8 KiB 38.9 KiB 86.5 KiB
int-set-1000 serialize 642.57 ns ±0.7% 10.25 μs ±0.3% 13.74 μs ±0.1% 4.17 μs ±0.6% 8.07 μs ±0.2% 8.59 μs ±0.6%
int-set-1000 deserialize 15.60 μs ±0.5% 21.47 μs ±0.3% 19.77 μs ±0.5% 18.62 μs ±0.3% 18.60 μs ±0.3% 56.26 μs ±0.2%
int-set-1000 size 3.9 KiB 4.8 KiB 4.9 KiB 4.9 KiB 4.8 KiB 10.2 KiB
record serialize 30.88 ns ±0.6% 121.33 ns ±0.3% 187.32 ns ±0.4% 82.47 ns ±0.9% 174.66 ns ±2% 260.71 ns ±2%
record deserialize 42.21 ns ±0.7% 210.82 ns ±0.6% 164.71 ns ±0.9% 121.55 ns ±0.4% 87.14 ns ±0.6% 555.60 ns ±0.7%
record size 83 B 65 B 52 B 56 B 51 B 141 B
records-1000 serialize 18.32 μs ±0.4% 161.00 μs ±0.8% 179.46 μs ±0.3% 82.48 μs ±0.2% 87.80 μs ±0.4% 253.14 μs ±0.4%
records-1000 deserialize 98.77 μs ±0.7% 266.67 μs ±1% 232.23 μs ±0.4% 171.66 μs ±0.7% 145.15 μs ±0.4% 678.22 μs ±1%
records-1000 size 81.9 KiB 70.3 KiB 63.4 KiB 63.9 KiB 55.1 KiB 161.9 KiB
scattered-1m serialize 32.47 ms ±0.5% 178.59 ms ±0.0% 296.64 ms ±0.1% 216.26 ms ±0.2% 242.69 ms ±0.1% 397.26 ms ±0.1%
scattered-1m deserialize 182.18 ms ±0.1% 323.34 ms ±0.2% 334.61 ms ±0.2% 272.99 ms ±0.1% 254.20 ms ±0.2% 763.72 ms ±0.1%
scattered-1m size 84852.4 KiB 86412.6 KiB 91017.8 KiB 91320.7 KiB 73393.7 KiB 197331.9 KiB
string-set-1000 serialize 2.61 μs ±0.4% 8.91 μs ±0.5% 6.93 μs ±0.8% 6.29 μs ±0.6% 9.51 μs ±0.6% 12.65 μs ±0.8%
string-set-1000 deserialize 58.28 μs ±0.6% 77.78 μs ±0.6% 73.81 μs ±0.3% 80.72 μs ±0.5% 86.19 μs ±0.7% 100.97 μs ±0.3%
string-set-1000 size 10.6 KiB 11.6 KiB 10.6 KiB 10.6 KiB 10.6 KiB 12.6 KiB
strings-1000 serialize 2.11 μs ±0.8% 9.36 μs ±0.5% 7.33 μs ±0.3% 6.13 μs ±0.6% 9.76 μs ±0.2% 12.12 μs ±0.8%
strings-1000 deserialize 30.25 μs ±0.7% 52.31 μs ±0.3% 43.15 μs ±0.5% 44.70 μs ±0.2% 41.47 μs ±0.2% 53.03 μs ±0.3%
strings-1000 size 10.6 KiB 11.6 KiB 10.6 KiB 10.6 KiB 10.6 KiB 12.6 KiB
strings-mixed-1000 serialize 8.35 μs ±0.4% 9.01 μs ±1% 7.28 μs ±0.6% 6.09 μs ±0.3% 9.79 μs ±0.3% 18.93 μs ±0.4%
strings-mixed-1000 deserialize 41.71 μs ±0.5% 68.79 μs ±0.6% 54.87 μs ±0.8% 57.39 μs ±0.3% 55.23 μs ±0.3% 66.85 μs ±0.3%
strings-mixed-1000 size 20.4 KiB 21.4 KiB 20.4 KiB 20.4 KiB 20.4 KiB 22.3 KiB
strings-mixed-utf8-1000 serialize 11.06 μs ±0.7%
strings-mixed-utf8-1000 deserialize 59.63 μs ±0.7%
strings-mixed-utf8-1000 size 21.4 KiB
tracked-1000 serialize 96.54 μs ±0.3%
tracked-1000 deserialize 519.15 μs ±0.2%
tracked-1000 size 15.6 KiB

🌐 Arm64: TypeScript runtime benchmark

Generated TypeScript of v4.0.0-rc.9 against Protocol Buffers, MessagePack and JSON, in Node, on Arm64

The code nino-gen generates for runtimes/typescript/bench (Program.cs's types), against Protocol Buffers (protobuf-es), MessagePack (msgpackr) and JSON (to and from UTF-8 bytes), in Node v27.0.0-alpha.0.0.0, on data .NET wrote, timed by tinybench 6.2.2: the mean time of a pass over each scenario's values (each pass the next of 64 variants, so that no pass reads what the one before read), ± its relative margin of error, and passes per second. Measured on a GitHub Arm64 runner.

Scenario Operation Nino Protobuf MessagePack JSON
Player x1000 serialize 240.87 μs ±0.3% (4,152/s) 3.26 ms ±6% (307/s) 1.84 ms ±0.2% (542/s) 2.16 ms ±7% (463/s)
Player x1000 serializeInto 171.88 μs ±0.2% (5,818/s)
Player x1000 deserialize 489.69 μs ±1% (2,042/s) 2.49 ms ±4% (401/s) 1.64 ms ±0.3% (611/s) 1.66 ms ±0.3% (603/s)
Player x1000 size 118.3 KiB 100.2 KiB 187.9 KiB 285.5 KiB
Zoo 50 x 100 animals (type ids) serialize 188.50 μs ±0.2% (5,305/s) 1.48 ms ±3% (675/s) 1.89 ms ±0.0% (529/s) 351.56 μs ±2% (2,844/s)
Zoo 50 x 100 animals (type ids) serializeInto 178.43 μs ±0.0% (5,605/s)
Zoo 50 x 100 animals (type ids) deserialize 145.97 μs ±0.4% (6,851/s) 2.62 ms ±5% (381/s) 1.28 ms ±0.2% (784/s) 1.54 ms ±0.8% (650/s)
Zoo 50 x 100 animals (type ids) size 71.4 KiB 71.3 KiB 117.5 KiB 161.2 KiB
OrderBook 100 x 50 orders serialize 387.36 μs ±0.2% (2,582/s) 2.78 ms ±3% (360/s) 3.26 ms ±0.2% (306/s) 871.34 μs ±1.0% (1,148/s)
OrderBook 100 x 50 orders serializeInto 357.95 μs ±0.1% (2,794/s)
OrderBook 100 x 50 orders deserialize 441.65 μs ±0.3% (2,264/s) 4.24 ms ±4% (236/s) 3.55 ms ±0.2% (282/s) 1.34 ms ±0.4% (744/s)
OrderBook 100 x 50 orders size 225.1 KiB 235.9 KiB 433.9 KiB 551.3 KiB
Article x200 (text) serialize 148.13 μs ±0.5% (6,751/s) 1.83 ms ±4% (546/s) 360.96 μs ±0.3% (2,770/s) 882.63 μs ±4% (1,133/s)
Article x200 (text) serializeInto 96.64 μs ±0.1% (10,347/s)
Article x200 (text) deserialize 177.13 μs ±0.5% (5,646/s) 610.04 μs ±4% (1,639/s) 393.05 μs ±0.4% (2,544/s) 596.20 μs ±0.5% (1,677/s)
Article x200 (text) size 430.2 KiB 421.6 KiB 428.2 KiB 434.2 KiB
Mesh 20 x (2 x 500 Vec3, 1500 int) serialize 232.18 μs ±0.6% (4,307/s) 4.55 ms ±1.0% (220/s) 7.88 ms ±0.6% (127/s) 2.98 ms ±0.5% (336/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) serializeInto 198.76 μs ±0.3% (5,031/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) deserialize 433.14 μs ±5% (2,309/s) 6.83 ms ±6% (146/s) 2.69 ms ±0.5% (372/s) 4.54 ms ±0.4% (220/s)
Mesh 20 x (2 x 500 Vec3, 1500 int) size 351.9 KiB 383.3 KiB 769.5 KiB 1514.3 KiB
Samples 20 x (3 x 1000 numbers) serialize 107.55 μs ±1% (9,298/s) 1.33 ms ±1% (752/s) 867.21 μs ±0.2% (1,153/s) 1.48 ms ±0.5% (675/s)
Samples 20 x (3 x 1000 numbers) serializeInto 83.65 μs ±0.0% (11,955/s)
Samples 20 x (3 x 1000 numbers) deserialize 106.09 μs ±2% (9,426/s) 1.40 ms ±8% (716/s) 692.55 μs ±0.4% (1,444/s) 1.76 ms ±0.4% (567/s)
Samples 20 x (3 x 1000 numbers) size 312.8 KiB 293.0 KiB 448.0 KiB 876.1 KiB
Lookup 50 x (2 maps of 100) serialize 330.10 μs ±0.4% (3,029/s) 1.95 ms ±2% (512/s) 624.10 μs ±0.4% (1,602/s) 1.09 ms ±0.8% (917/s)
Lookup 50 x (2 maps of 100) serializeInto 302.02 μs ±0.1% (3,311/s)
Lookup 50 x (2 maps of 100) deserialize 1.18 ms ±0.7% (845/s) 3.59 ms ±3% (278/s) 1.88 ms ±2% (531/s) 4.52 ms ±9% (221/s)
Lookup 50 x (2 maps of 100) size 156.2 KiB 178.4 KiB 147.7 KiB 194.5 KiB
Event x1000 (long) serialize 68.40 μs ±0.4% (14,621/s) 1.78 ms ±5% (563/s) 758.98 μs ±0.2% (1,318/s) 2.20 ms ±5% (454/s)
Event x1000 (long) serializeInto 37.07 μs ±0.2% (26,974/s)
Event x1000 (long) deserialize 62.18 μs ±0.6% (16,083/s) 768.16 μs ±6% (1,302/s) 271.05 μs ±0.3% (3,689/s) 636.69 μs ±0.4% (1,571/s)
Event x1000 (long) size 55.7 KiB 50.6 KiB 77.1 KiB 151.9 KiB
Strings 1000 (ASCII) serialize 24.13 μs ±0.3% (41,435/s) 49.14 μs ±0.7% (20,350/s) 37.82 μs ±0.2% (26,443/s) 12.61 μs ±0.5% (79,296/s)
Strings 1000 (ASCII) serializeInto 23.08 μs ±0.1% (43,329/s)
Strings 1000 (ASCII) deserialize 15.94 μs ±0.4% (62,718/s) 183.76 μs ±8% (5,442/s) 34.43 μs ±0.4% (29,041/s) 33.60 μs ±0.9% (29,764/s)
Strings 1000 (ASCII) size 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB
Strings 1000 (ASCII, Latin-1, other) serialize 35.18 μs ±0.3% (28,425/s) 134.14 μs ±0.3% (7,455/s) 54.20 μs ±0.2% (18,452/s) 32.15 μs ±0.3% (31,108/s)
Strings 1000 (ASCII, Latin-1, other) serializeInto 33.55 μs ±0.0% (29,803/s)
Strings 1000 (ASCII, Latin-1, other) deserialize 34.35 μs ±0.3% (29,114/s) 259.11 μs ±0.3% (3,859/s) 87.09 μs ±0.3% (11,482/s) 52.43 μs ±0.3% (19,074/s)
Strings 1000 (ASCII, Latin-1, other) size 20.4 KiB 21.4 KiB 20.4 KiB 22.4 KiB
IntSet 20 x 1000 serialize 65.38 μs ±0.3% (15,294/s) 570.91 μs ±1% (1,752/s) 282.53 μs ±0.3% (3,540/s) 420.43 μs ±0.5% (2,379/s)
IntSet 20 x 1000 serializeInto 58.09 μs ±0.0% (17,215/s)
IntSet 20 x 1000 deserialize 643.78 μs ±0.3% (1,553/s) 956.90 μs ±0.3% (1,045/s) 737.09 μs ±0.4% (1,357/s) 1.06 ms ±0.3% (940/s)
IntSet 20 x 1000 size 78.2 KiB 95.3 KiB 97.9 KiB 205.0 KiB
StringSet 20 x 1000 serialize 495.85 μs ±0.4% (2,017/s) 1.02 ms ±1% (985/s) 852.04 μs ±0.2% (1,174/s) 278.75 μs ±0.7% (3,587/s)
StringSet 20 x 1000 serializeInto 473.02 μs ±0.1% (2,114/s)
StringSet 20 x 1000 deserialize 4.40 ms ±3% (227/s) 7.39 ms ±2% (135/s) 4.88 ms ±3% (205/s) 5.25 ms ±3% (190/s)
StringSet 20 x 1000 size 212.8 KiB 232.2 KiB 212.9 KiB 252.0 KiB

🐹 Arm64: Go runtime benchmark

The Go runtime of v4.0.0-rc.9 against Protocol Buffers, MessagePack, encoding/json and gob, on Arm64

runtimes/go/bench (testing.B, summarized by benchstat: medians ± their 95% confidence interval): codecs in the shape nino-gen generates (Nino) and the struct tags (NinoTags) against Protocol Buffers (google.golang.org/protobuf), MessagePack (vmihailenco/msgpack), encoding/json and gob, on linux/arm64. Allocations are counted per operation; sizes are the encoded bytes. Measured on a GitHub Arm64 runner.

Case Operation Nino NinoTags Protobuf MessagePack JSON Gob
simple-class serialize 459.80 ns ±2% 929.80 ns ±0% 4.47 μs ±1% 5.88 μs ±0% 8.51 μs ±1% 9.09 μs ±0%
simple-class deserialize 1.36 μs ±2% 1.80 μs ±1% 5.97 μs ±1% 11.08 μs ±1% 14.95 μs ±0% 24.83 μs ±0%
simple-class serialize allocs 0 1 80 41 15 65
simple-class deserialize allocs 12 16 66 64 29 254
simple-class size 1.0 KiB 1.0 KiB 1.1 KiB 1.2 KiB 1.9 KiB 1.3 KiB
simple-class-100 serialize 45.99 μs ±0% 90.37 μs ±0% 456.18 μs ±0% 594.57 μs ±0% 878.06 μs ±1% 419.38 μs ±0%
simple-class-100 deserialize 142.10 μs ±1% 173.62 μs ±0% 608.61 μs ±1% 1.12 ms ±0% 1.53 ms ±1% 507.24 μs ±0%
simple-class-100 serialize allocs 0 101 8000 4101 1403 4042
simple-class-100 deserialize allocs 1204 1407 6609 6208 2839 2749
simple-class-100 size 104.4 KiB 104.4 KiB 111.4 KiB 122.9 KiB 193.1 KiB 107.1 KiB
scattered-1m serialize 292.11 ms ±2% 345.79 ms ±2% 656.68 ms ±2% 596.12 ms ±1% 746.49 ms ±4% 569.35 ms ±1%
scattered-1m deserialize 67.56 ms ±3% 137.45 ms ±1% 207.64 ms ±3% 434.76 ms ±3% 714.08 ms ±1% 213.98 ms ±4%
scattered-1m serialize allocs 0 1 0 1 4 64
scattered-1m deserialize allocs 1017237 1017240 3000039 3000010 3000044 3000187
scattered-1m size 48611.1 KiB 48611.1 KiB 52501.2 KiB 70095.5 KiB 92173.2 KiB 52879.2 KiB
int-set-1000 serialize 110.00 ns ±0% 178.40 ns ±0% 5.92 μs ±0% 27.21 μs ±0% 24.05 μs ±0% 12.41 μs ±1%
int-set-1000 deserialize 3.11 μs ±1% 1.35 μs ±1% 7.97 μs ±0% 45.16 μs ±0% 63.29 μs ±0% 20.87 μs ±1%
int-set-1000 serialize allocs 0 1 0 1 3 24
int-set-1000 deserialize allocs 2 5 2 8 13 154
int-set-1000 size 3.9 KiB 3.9 KiB 4.8 KiB 4.9 KiB 10.2 KiB 4.9 KiB
string-set-1000 serialize 2.64 μs ±0% 11.03 μs ±2% 11.23 μs ±1% 33.26 μs ±0% 42.76 μs ±0% 30.28 μs ±3%
string-set-1000 deserialize 31.15 μs ±0% 60.96 μs ±1% 45.84 μs ±0% 130.79 μs ±1% 150.69 μs ±0% 103.97 μs ±1%
string-set-1000 serialize allocs 0 1 0 1 3 27
string-set-1000 deserialize allocs 38 1010 1012 2008 2013 2154
string-set-1000 size 10.6 KiB 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB 10.7 KiB
strings-1000 serialize 2.31 μs ±0% 2.43 μs ±1% 10.71 μs ±1% 10.44 μs ±0% 28.85 μs ±0% 21.56 μs ±2%
strings-1000 deserialize 11.44 μs ±5% 11.83 μs ±2% 45.16 μs ±0% 41.80 μs ±1% 92.30 μs ±0% 44.60 μs ±1%
strings-1000 serialize allocs 0 1 0 1 3 27
strings-1000 deserialize allocs 7 9 1012 1004 1013 1153
strings-1000 size 10.6 KiB 10.6 KiB 11.6 KiB 10.6 KiB 12.6 KiB 10.7 KiB
strings-mixed-1000 serialize 10.23 μs ±0% 10.37 μs ±2% 23.24 μs ±0% 10.94 μs ±0% 52.86 μs ±0% 33.94 μs ±2%
strings-mixed-1000 deserialize 25.84 μs ±0% 26.23 μs ±1% 55.68 μs ±1% 42.16 μs ±1% 146.50 μs ±0% 49.02 μs ±1%
strings-mixed-1000 serialize allocs 0 1 0 1 3 29
strings-mixed-1000 deserialize allocs 12 14 1012 1004 1013 1153
strings-mixed-1000 size 20.4 KiB 20.4 KiB 21.4 KiB 20.4 KiB 22.3 KiB 20.4 KiB
strings-mixed-utf8-1000 serialize 13.72 μs ±0%
strings-mixed-utf8-1000 deserialize 26.07 μs ±1%
strings-mixed-utf8-1000 serialize allocs 0
strings-mixed-utf8-1000 deserialize allocs 12
strings-mixed-utf8-1000 size 21.4 KiB

🦀 Arm64: Rust runtime benchmark

The Rust runtime of v4.0.0-rc.9 against Protocol Buffers, MessagePack, bincode, postcard and serde_json, on Arm64

runtimes/rust/bench (criterion): codecs in the shape nino-gen generates against Protocol Buffers (prost), MessagePack (rmp-serde), bincode, postcard and serde_json. Times are criterion's mean estimates ± half their 95% confidence interval; sizes are the encoded bytes of each case. Measured on a GitHub Arm64 runner.

Case Operation nino prost rmp-serde bincode postcard serde_json
f64-10000 serialize 1.33 μs ±0.0% 6.28 μs ±0.0% 21.72 μs ±0.0% 6.28 μs ±0.0% 7.95 μs ±0.1% 187.07 μs ±0.2%
f64-10000 deserialize 1.35 μs ±0.1% 28.60 μs ±11% 41.20 μs ±0.1% 20.32 μs ±0.5% 9.51 μs ±0.0% 169.24 μs ±0.0%
f64-10000 size 78.1 KiB 78.1 KiB 87.9 KiB 78.1 KiB 78.1 KiB 66.2 KiB
i32-10000 serialize 495.45 ns ±0.3% 57.72 μs ±0.5% 88.65 μs ±0.9% 40.28 μs ±0.7% 53.91 μs ±0.6% 68.19 μs ±3%
i32-10000 deserialize 495.91 ns ±0.3% 45.19 μs ±5% 41.74 μs ±0.2% 33.70 μs ±0.8% 21.51 μs ±0.2% 136.79 μs ±0.0%
i32-10000 size 39.1 KiB 38.8 KiB 48.8 KiB 48.8 KiB 38.9 KiB 86.5 KiB
int-set-1000 serialize 600.26 ns ±0.0% 6.21 μs ±0.2% 8.96 μs ±1.0% 3.96 μs ±0.7% 6.10 μs ±0.6% 8.46 μs ±1%
int-set-1000 deserialize 18.20 μs ±0.1% 23.66 μs ±0.0% 22.30 μs ±0.1% 21.15 μs ±0.6% 19.66 μs ±0.1% 52.39 μs ±0.1%
int-set-1000 size 3.9 KiB 4.8 KiB 4.9 KiB 4.9 KiB 4.8 KiB 10.2 KiB
record serialize 22.84 ns ±3% 105.79 ns ±0.5% 140.85 ns ±0.4% 73.28 ns ±1.0% 166.04 ns ±0.1% 191.83 ns ±0.1%
record deserialize 42.76 ns ±0.1% 194.81 ns ±0.0% 139.73 ns ±0.1% 111.49 ns ±0.7% 65.54 ns ±0.2% 470.17 ns ±0.1%
record size 83 B 65 B 52 B 56 B 51 B 141 B
records-1000 serialize 11.46 μs ±0.6% 131.37 μs ±0.2% 128.19 μs ±0.5% 74.20 μs ±0.6% 72.95 μs ±0.3% 201.50 μs ±0.0%
records-1000 deserialize 95.93 μs ±0.0% 236.83 μs ±0.0% 210.52 μs ±0.0% 164.49 μs ±0.0% 135.11 μs ±0.0% 569.35 μs ±0.0%
records-1000 size 81.9 KiB 70.3 KiB 63.4 KiB 63.9 KiB 55.1 KiB 161.9 KiB
scattered-1m serialize 38.08 ms ±4% 138.67 ms ±0.2% 269.42 ms ±0.6% 215.55 ms ±0.3% 222.37 ms ±0.5% 467.45 ms ±0.2%
scattered-1m deserialize 102.35 ms ±0.3% 218.46 ms ±0.1% 225.01 ms ±0.2% 171.93 ms ±0.1% 153.47 ms ±0.1% 574.05 ms ±0.1%
scattered-1m size 84852.4 KiB 86412.6 KiB 91017.8 KiB 91320.7 KiB 73393.7 KiB 197331.9 KiB
string-set-1000 serialize 2.14 μs ±0.1% 7.23 μs ±0.6% 3.65 μs ±0.1% 4.82 μs ±0.6% 7.94 μs ±0.9% 9.45 μs ±0.0%
string-set-1000 deserialize 56.56 μs ±0.0% 79.32 μs ±0.0% 70.71 μs ±0.1% 71.66 μs ±0.1% 77.40 μs ±0.1% 102.57 μs ±0.0%
string-set-1000 size 10.6 KiB 11.6 KiB 10.6 KiB 10.6 KiB 10.6 KiB 12.6 KiB
strings-1000 serialize 1.72 μs ±0.2% 7.25 μs ±0.6% 3.62 μs ±0.1% 4.81 μs ±0.6% 7.84 μs ±1.0% 8.96 μs ±0.0%
strings-1000 deserialize 30.12 μs ±0.1% 53.09 μs ±0.0% 39.89 μs ±0.1% 41.17 μs ±0.1% 40.43 μs ±0.0% 49.96 μs ±0.0%
strings-1000 size 10.6 KiB 11.6 KiB 10.6 KiB 10.6 KiB 10.6 KiB 12.6 KiB
strings-mixed-1000 serialize 9.61 μs ±0.1% 7.25 μs ±0.5% 3.76 μs ±0.1% 4.93 μs ±0.6% 8.42 μs ±0.6% 13.16 μs ±0.1%
strings-mixed-1000 deserialize 39.47 μs ±0.5% 62.61 μs ±0.0% 48.53 μs ±0.0% 49.20 μs ±0.1% 49.04 μs ±0.0% 60.06 μs ±0.1%
strings-mixed-1000 size 20.4 KiB 21.4 KiB 20.4 KiB 20.4 KiB 20.4 KiB 22.3 KiB
strings-mixed-utf8-1000 serialize 9.61 μs ±0.1%
strings-mixed-utf8-1000 deserialize 58.65 μs ±0.1%
strings-mixed-utf8-1000 size 21.4 KiB
tracked-1000 serialize 81.95 μs ±0.1%
tracked-1000 deserialize 499.57 μs ±0.0%
tracked-1000 size 15.6 KiB

🎮 Unity benchmark (Burst, IL2CPP)

Unity 2022.3.62f2, IL2CPP player (C++ Release, code generation OptimizeSpeed, stripping Minimal, not a Development build, Nino.Core Release), Linux x64, AMD EPYC 9V74 80-Core Processor (4 cores), Burst 1.8.29 (x64 targets SSE2, SSE4, AVX2), kernels AVX2.
Unity 6000.3.27f1, IL2CPP player (C++ Release, code generation OptimizeSpeed, stripping Minimal, not a Development build, Nino.Core Release), Linux x64, AMD EPYC 7763 64-Core Processor (4 cores), Burst 1.8.31 (x64 targets SSE2, SSE4, AVX2), kernels AVX2.
Each time is the median per call; "Speedup" is without Burst divided by with Burst.

v4.0.0-rc.9, measured in the IL2CPP test player that .github/workflows/unity.yml builds and runs on a GitHub-hosted runner (Test.Runtime.Burst.BurstBenchmark) with the Unity Performance Testing package 3.6.0 (Measure.Method: its warm-up, then 9 measurements of about 100 ms, each the mean time per call): NinoSerializer.Serialize to a new array, NinoDeserializer.Deserialize into an array of the same length (arrays) or to a new value (strings, the list, a class), without the Burst kernels (NinoKernels.Register(null): Nino.Core's own paths, as without com.unity.burst) and with them. Compare within a table: the runners vary between releases.

Unity 2022.3.62f2

Case Operation Without Burst With Burst Speedup
(int, long)[32] Serialize 1.53 μs 462.87 ns 3.30×
(int, long)[32] Deserialize 1.13 μs 307.80 ns 3.67×
(int, long)[1000] Serialize 38.17 μs 3.97 μs 9.62×
(int, long)[1000] Deserialize 27.58 μs 636.59 ns 43.3×
(int, long)[100000] Serialize 3.89 ms 456.98 μs 8.51×
(int, long)[100000] Deserialize 2.73 ms 33.79 μs 80.9×
(byte, int)[32] Serialize 1.44 μs 372.02 ns 3.87×
(byte, int)[32] Deserialize 1.12 μs 278.43 ns 4.03×
(byte, int)[1000] Serialize 35.08 μs 1.16 μs 30.3×
(byte, int)[1000] Deserialize 27.78 μs 401.26 ns 69.2×
(byte, int)[100000] Serialize 3.50 ms 121.66 μs 28.8×
(byte, int)[100000] Deserialize 2.75 ms 15.92 μs 172.9×
(double, long, double, float, byte)[32] Serialize 4.60 μs 1.11 μs 4.15×
(double, long, double, float, byte)[32] Deserialize 4.80 μs 717.98 ns 6.69×
(double, long, double, float, byte)[1000] Serialize 126.52 μs 11.73 μs 10.8×
(double, long, double, float, byte)[1000] Deserialize 134.10 μs 4.34 μs 30.9×
(double, long, double, float, byte)[100000] Serialize 11.95 ms 753.63 μs 15.9×
(double, long, double, float, byte)[100000] Deserialize 13.33 ms 361.67 μs 36.9×
PaddedRaw[32] (short, long) Serialize 479.12 ns 272.64 ns 1.76×
PaddedRaw[32] (short, long) Deserialize 67.10 ns 67.58 ns 0.99×
PaddedRaw[1000] (short, long) Serialize 5.81 μs 4.22 μs 1.38×
PaddedRaw[1000] (short, long) Deserialize 370.48 ns 369.90 ns 1.00×
PaddedRaw[100000] (short, long) Serialize 534.27 μs 390.20 μs 1.37×
PaddedRaw[100000] (short, long) Deserialize 57.68 μs 57.54 μs 1.00×
ASCII string (32 chars) Serialize 143.72 ns 103.89 ns 1.38×
ASCII string (32 chars) Deserialize 67.78 ns 47.05 ns 1.44×
ASCII string (1000 chars) Serialize 1.77 μs 512.83 ns 3.44×
ASCII string (1000 chars) Deserialize 1.32 μs 304.02 ns 4.33×
ASCII string (100000 chars) Serialize 109.52 μs 30.66 μs 3.57×
ASCII string (100000 chars) Deserialize 113.33 μs 10.62 μs 10.7×
UTF-16 string (32 CJK chars) Serialize 108.82 ns 112.20 ns 0.97×
UTF-16 string (32 CJK chars) Deserialize 94.01 ns 95.19 ns 0.99×
UTF-16 string (1000 CJK chars) Serialize 662.38 ns 658.06 ns 1.01×
UTF-16 string (1000 CJK chars) Deserialize 610.04 ns 609.21 ns 1.00×
UTF-16 string (100000 CJK chars) Serialize 55.11 μs 52.82 μs 1.04×
UTF-16 string (100000 CJK chars) Deserialize 42.67 μs 42.69 μs 1.00×
List of 1000 ASCII strings (8–40 chars) Serialize 48.54 μs 34.94 μs 1.39×
List of 1000 ASCII strings (8–40 chars) Deserialize 70.59 μs 51.27 μs 1.38×
SimpleClass Serialize 1.37 μs 937.92 ns 1.46×
SimpleClass Deserialize 2.71 μs 2.57 μs 1.05×
SimpleClass[100] Serialize 110.13 μs 76.15 μs 1.45×
SimpleClass[100] Deserialize 206.48 μs 206.61 μs 1.00×
BenchBox<long>[1000] (4 longs, generic) Serialize 177.84 μs 178.16 μs 1.00×
BenchBox<long>[1000] (4 longs, generic) Deserialize 141.33 μs 141.35 μs 1.00×
BenchLongs[1000] (4 longs, non-generic) Serialize 34.76 μs 34.09 μs 1.02×
BenchLongs[1000] (4 longs, non-generic) Deserialize 25.92 μs 26.08 μs 0.99×
[NinoUtf8] ASCII string (32 chars) Serialize 202.75 ns 152.05 ns 1.33×
[NinoUtf8] ASCII string (32 chars) Deserialize 141.49 ns 124.41 ns 1.14×
[NinoUtf8] ASCII string (1000 chars) Serialize 741.25 ns 562.42 ns 1.32×
[NinoUtf8] ASCII string (1000 chars) Deserialize 866.51 ns 709.02 ns 1.22×
[NinoUtf8] ASCII string (100000 chars) Serialize 52.02 μs 42.30 μs 1.23×
[NinoUtf8] ASCII string (100000 chars) Deserialize 62.64 μs 47.87 μs 1.31×
[NinoUtf8] UTF-8 string (1000 CJK chars) Serialize 2.60 μs 2.59 μs 1.00×
[NinoUtf8] UTF-8 string (1000 CJK chars) Deserialize 2.67 μs 2.67 μs 1.00×

Unity 6000.3.27f1

Case Operation Without Burst With Burst Speedup
(int, long)[32] Serialize 1.93 μs 595.74 ns 3.24×
(int, long)[32] Deserialize 1.42 μs 389.10 ns 3.64×
(int, long)[1000] Serialize 47.20 μs 5.23 μs 9.03×
(int, long)[1000] Deserialize 34.37 μs 775.32 ns 44.3×
(int, long)[100000] Serialize 4.89 ms 644.54 μs 7.59×
(int, long)[100000] Deserialize 3.40 ms 37.51 μs 90.7×
(byte, int)[32] Serialize 1.76 μs 455.50 ns 3.86×
(byte, int)[32] Deserialize 1.42 μs 389.11 ns 3.65×
(byte, int)[1000] Serialize 43.29 μs 1.43 μs 30.2×
(byte, int)[1000] Deserialize 35.09 μs 554.04 ns 63.3×
(byte, int)[100000] Serialize 4.36 ms 166.40 μs 26.2×
(byte, int)[100000] Deserialize 3.48 ms 18.83 μs 184.7×
(double, long, double, float, byte)[32] Serialize 5.68 μs 1.39 μs 4.08×
(double, long, double, float, byte)[32] Deserialize 5.95 μs 860.37 ns 6.92×
(double, long, double, float, byte)[1000] Serialize 152.67 μs 15.71 μs 9.72×
(double, long, double, float, byte)[1000] Deserialize 167.15 μs 5.24 μs 31.9×
(double, long, double, float, byte)[100000] Serialize 14.84 ms 998.45 μs 14.9×
(double, long, double, float, byte)[100000] Deserialize 16.68 ms 442.43 μs 37.7×
PaddedRaw[32] (short, long) Serialize 367.56 ns 346.87 ns 1.06×
PaddedRaw[32] (short, long) Deserialize 72.80 ns 72.41 ns 1.01×
PaddedRaw[1000] (short, long) Serialize 7.62 μs 6.09 μs 1.25×
PaddedRaw[1000] (short, long) Deserialize 369.81 ns 372.71 ns 0.99×
PaddedRaw[100000] (short, long) Serialize 721.10 μs 532.93 μs 1.35×
PaddedRaw[100000] (short, long) Deserialize 64.69 μs 64.58 μs 1.00×
ASCII string (32 chars) Serialize 143.04 ns 124.04 ns 1.15×
ASCII string (32 chars) Deserialize 116.75 ns 56.61 ns 2.06×
ASCII string (1000 chars) Serialize 1.55 μs 672.10 ns 2.30×
ASCII string (1000 chars) Deserialize 1.86 μs 661.95 ns 2.81×
ASCII string (100000 chars) Serialize 131.00 μs 43.02 μs 3.05×
ASCII string (100000 chars) Deserialize 144.16 μs 23.48 μs 6.14×
UTF-16 string (32 CJK chars) Serialize 131.48 ns 131.49 ns 1.00×
UTF-16 string (32 CJK chars) Deserialize 118.12 ns 112.87 ns 1.05×
UTF-16 string (1000 CJK chars) Serialize 874.66 ns 897.67 ns 0.97×
UTF-16 string (1000 CJK chars) Deserialize 783.90 ns 789.48 ns 0.99×
UTF-16 string (100000 CJK chars) Serialize 148.77 μs 139.56 μs 1.07×
UTF-16 string (100000 CJK chars) Deserialize 60.02 μs 58.07 μs 1.03×
List of 1000 ASCII strings (8–40 chars) Serialize 59.85 μs 43.69 μs 1.37×
List of 1000 ASCII strings (8–40 chars) Deserialize 91.59 μs 66.39 μs 1.38×
SimpleClass Serialize 1.72 μs 1.32 μs 1.31×
SimpleClass Deserialize 3.39 μs 3.22 μs 1.05×
SimpleClass[100] Serialize 156.03 μs 108.51 μs 1.44×
SimpleClass[100] Deserialize 262.06 μs 262.42 μs 1.00×
BenchBox<long>[1000] (4 longs, generic) Serialize 213.05 μs 213.86 μs 1.00×
BenchBox<long>[1000] (4 longs, generic) Deserialize 167.55 μs 167.89 μs 1.00×
BenchLongs[1000] (4 longs, non-generic) Serialize 41.17 μs 41.29 μs 1.00×
BenchLongs[1000] (4 longs, non-generic) Deserialize 32.88 μs 32.93 μs 1.00×
[NinoUtf8] ASCII string (32 chars) Serialize 266.63 ns 192.27 ns 1.39×
[NinoUtf8] ASCII string (32 chars) Deserialize 187.56 ns 168.92 ns 1.11×
[NinoUtf8] ASCII string (1000 chars) Serialize 1.04 μs 763.19 ns 1.36×
[NinoUtf8] ASCII string (1000 chars) Deserialize 1.21 μs 1.01 μs 1.19×
[NinoUtf8] ASCII string (100000 chars) Serialize 67.24 μs 52.80 μs 1.27×
[NinoUtf8] ASCII string (100000 chars) Deserialize 93.73 μs 75.05 μs 1.25×
[NinoUtf8] UTF-8 string (1000 CJK chars) Serialize 3.89 μs 3.84 μs 1.01×
[NinoUtf8] UTF-8 string (1000 CJK chars) Deserialize 3.93 μs 3.88 μs 1.01×