MemoryPack
Newtonsoft.Json-for-Unity
MemoryPack | Newtonsoft.Json-for-Unity | |
---|---|---|
5 | 3 | |
2,806 | 1,048 | |
3.2% | - | |
8.8 | 3.2 | |
25 days ago | about 2 years ago | |
C# | C# | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
MemoryPack
- .NET 9 will be putting BinaryFormatter out to pasture
-
Godot + MemoryPack
I just stumbled over the serializer MemoryPack, which looks incredible.
-
Fury: 170x faster than JDK, fast serialization powered by JIT and Zero-copy
Given it's a binary serialization framework, it should not be too difficult, because the domain is well-explored and numerous libraries exist in C# which address same goals that Fury does.
More popular/newer examples are https://github.com/Cysharp/MemoryPack (which is similar to Fury with its own spec, C#-code first schema), https://github.com/MessagePack-CSharp/MessagePack-CSharp or even gRPC / Protobuf tooling https://github.com/grpc/grpc-dotnet
-
Native AOT Overview
With Unity/IL2CPP stuff: For general-purpose serialization libraries like JSON, you sometimes need to provide hints to make sure types are included: https://github.com/jilleJr/Newtonsoft.Json-for-Unity/wiki/Fi...
For schema serialization on known types, there are codegen tools (i.e. moc for MessagePack): https://github.com/neuecc/MessagePack-CSharp
MessagePack is migrating to Rosalyn code generators, so basically invisible codegen. Cysharp's newer serialization library, MessagePack, already uses this: https://github.com/Cysharp/MemoryPack
- GitHub - Cysharp/MemoryPack: Zero encoding extreme performance binary serializer for C#.
Newtonsoft.Json-for-Unity
-
Native AOT Overview
With Unity/IL2CPP stuff: For general-purpose serialization libraries like JSON, you sometimes need to provide hints to make sure types are included: https://github.com/jilleJr/Newtonsoft.Json-for-Unity/wiki/Fi...
For schema serialization on known types, there are codegen tools (i.e. moc for MessagePack): https://github.com/neuecc/MessagePack-CSharp
MessagePack is migrating to Rosalyn code generators, so basically invisible codegen. Cysharp's newer serialization library, MessagePack, already uses this: https://github.com/Cysharp/MemoryPack
-
A small but useful class for creating saved variables in PlayerPrefs
But Newtonsoft.JSON can't serialize any object (like Vector3, for example) painlessly either. That's why I recommend to check out the Converters library — it solves a lot of problems.
-
I'm losing my mind. A month ago, I worked on a Unity project and ChatGPT helped me import a JSON parser quickly and correctly. Today, when I reused the project as a template, I faced same error, but instead of a swift answer I was fighting with it for 1 hour. Solutions/links were outdated and wrong.
In any case you can install it through the official method, it's a weird package because it's hidden in the package menu
What are some alternatives?
fury-benchmarks - Serialization Benchmarks for fury with other libraries
corert - This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
janino - Janino is a super-small, super-fast Java™ compiler.
Unity.Newtonsoft.Json
incubator-fury - A blazingly fast multi-language serialization framework powered by JIT and zero-copy.
Unity3d-RectMask2DCulling - Custom RectMask2D, that allow to disable Culling / Softness for better performance
bridge-info - Information about SourceGear Bridge, a .NET Native AOT binding generator
bflat - C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)
Oberon - Oberon parser, code model & browser, compiler and IDE with debugger
jvm-serializers - Benchmark comparing serialization libraries on the JVM
MessagePack for C# (.NET, .NET Core, Unity, Xamarin) - Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]