forked from MessagePack-CSharp/MessagePack-CSharp
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into support-record
- Loading branch information
Showing
9 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# MessagePack.Experimental | ||
|
||
This C# project is the experimental project for the features which are very complex, unstable or unsafe. | ||
|
||
- [HardwareIntrinsics](HardwareIntrinsics/HardwareIntrinsics.md) | ||
- [UnsafeUnmanagedStructFormatter](UnsafeUnmanagedStructFormatter/UnsafeUnmanagedStructFormatter.md) | ||
|
||
**Caution!** | ||
|
||
`MessagePack.Experimental` only targets `.NET Core 3.1` and above. | ||
You can not use this in Unity and .NET Framework. |
24 changes: 24 additions & 0 deletions
24
src/MessagePack.Experimental/HardwareIntrinsics/HardwareIntrinsics.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Abstract | ||
|
||
`Hardware Intrinsics` is a feature in order to utilize maximum power of the cpu. | ||
You can serialize/deserialize primitive type array much faster than current implementation! | ||
|
||
Supported types | ||
|
||
- `sbyte[]` | ||
- `short[]` | ||
- `int[]` | ||
- `bool[]` | ||
- `float[]` | ||
- `double[]` | ||
|
||
# Usage | ||
|
||
```csharp | ||
var resolver = MessagePack.Resolvers.CompositeResolver.Create(new[] { PrimitiveArrayResolver.Instance, MessagePack.Resolvers.StandardResolver.Instance }); | ||
``` | ||
|
||
# When will this feature become official? | ||
|
||
- The MessagePack-CSharp's lowest target framework is greater or equals to `.NET Core 3.1`. | ||
- The current very complex and hard to understand implementation is rewritten. |
29 changes: 29 additions & 0 deletions
29
...k.Experimental/UnsafeUnmanagedStructFormatter/UnsafeUnmanagedStructFormatter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Abstract | ||
|
||
`UnsafeUnmanagedStructFormatter`s (de)serialize the blittable value(s) directly. | ||
They are very performant but unstable against the endian. | ||
|
||
You should be careful not to share the encoded byte[] among the different endian environments. | ||
|
||
Supported types (T where T : unamanaged) | ||
|
||
- `T` → `UnsafeUnmanagedStructFormatter<T>` | ||
- `T[]` → `UnsafeUnmanagedStructArrayFormatter<T>` | ||
- `Memory<T>` → `UnsafeUnmanagedStructMemoryFormatter<T>` | ||
- `ReadOnlyMemory<T>` → `UnsafeUnmanagedStructReadOnlyMemoryFormatter<T>` | ||
- `ReadOnlySequence<T>` → `UnsafeUnmanagedStructReadOnlySequenceFormatter<T>` | ||
|
||
# Usage | ||
|
||
```csharp | ||
var resolver = MessagePack.Resolvers.CompositeResolver.Create( | ||
new[] { new UnsafeUnmanagedStructFormatter<Matrix4x4>(typeCode: 96) }, | ||
new[] { MessagePack.Resolvers.StandardResolver.Instance }); | ||
``` | ||
|
||
The constructor takes 1 sbyte value. | ||
The sbyte value is the extension type code embedded in serialized byte sequence. | ||
|
||
# When will this feature become official? | ||
|
||
- Requests are needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters