-
Notifications
You must be signed in to change notification settings - Fork 174
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
MessagePack serialization time dominated by expression compilation. #14
Comments
It helps dynamic object serialization, but your case looks like unintended one. Auto generated serializer should not use PackObject in usual cases, so it seems to be a bug. |
The exact object being serialized is a
I am working on putting together some code that exhibits the problem for you. |
The reason of I wonder why do you use Thank you! |
The messages in each direction are not the same. This is a request/reply RPC system. The request is a Dict mapping from strings to a list of either int, float, double or string. (So the variable type kinda has to be The reply is either an error message, or a list of double. Does it make a bit more sense now? |
Here is a .cs file with a short program that exercises all the code paths I am using in the MessagePack C# library: https://gist.github.com/chrish42/e975c355f4118ebe2e70 Thanks for looking into this! |
Thank you. If you use only primitive type or its collection only, you can use You can find API document here: If you need more sample code snippets for I will improve the wiki to notice this performance pit anyway. Thanks! |
The change to Closing this issue, as the switch to |
I am using MessagePack for a library that sends messages from a client to a server via a message queue. The objects I am sending are a Dictionnary<string, List>. The speed was really lacking, though.
Doing some profiling, I found out that the execution profile on the client is dominated (> 80%) by the PackerUnpackerExtensions' packObjectCore method call. Actually, what's dominating the profile is the call to compile() (which is done each time).
Is it possible to speed things up there? Any reason why the right methods are not called directly (instead of compiling code dynamically that does the call)?
The text was updated successfully, but these errors were encountered: