Skip to content

Please remove optimize on string read/write. #505

@neuecc

Description

@neuecc

v2 includes string optimization(it is commented out in v1).
https://github.com/neuecc/MessagePack-CSharp/blob/260c05b3/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicObjectResolver.cs#L1212

My latest work, MasterMemory uses a hook to string type.
It does interning all string value.
https://github.com/Cysharp/MasterMemory/blob/master/src/MasterMemory/Internal/InternStringResolver.cs#L28

But v2 implementation can not use this hack.

If we remove the String optimization, MicroBenchmark will lose performance.
But usually, String Encode / Decode should cost more than virtual calls.
It does not lose for real scenario(MicroBenchmark scenario may uses short string value, it is not realistic).

If remove string optimization, we can solve #504 easily.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions