Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a formatter for MessagePack for performance reasons #10

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

zbalkan
Copy link
Contributor

@zbalkan zbalkan commented Dec 19, 2021

I needed a binary formatted message for performance reasons. So, I used MessagePack to achieve this goal. Also, it is possible with MessagePack to convert to JSON for debugging purposes. In my project, I used a couple of #IF DEBUGs but it would be unnecessary for this context. The performance gain is not huge but it helps when the traffic load gets higher.

Currently, it only supports .NET Standard 2.0 and above. .NET Framework support does not exist.

P.S: Initially I was planning to use ZeroFormatter, but since the benchmarks show no significant gain and MessagePack has the ability to convert to JSON quickly, I took that path.

P.S 2: You created such a nicely crafted library that implementing such a thing was trivial. I appreciate your craftsmanship! Since I used this in my personal project, I believe it would be better to contribute to the project itself.

@HavenDV
Copy link
Owner

HavenDV commented Dec 20, 2021

I'll explain a little - now that you use MessagePackAnalyzer, this library and its dependencies will be delivered along with your other libraries. Therefore, you need to use PrivateAssets="all" so that the library is available only at compile time
I added a PR with DevelopmentDependency for the MessagePackAnalyzer to do this automatically after install package: MessagePack-CSharp/MessagePack-CSharp#1361

@HavenDV
Copy link
Owner

HavenDV commented Dec 20, 2021

I have corrected the location of the projects and the .csproj themselves a bit. Note that although not explicitly supported by the .Net Framework, .Net Standard 2.0 is available from .Net Framework 4.6.1/4.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants