-
Notifications
You must be signed in to change notification settings - Fork 325
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
Better deserialization and serialization performance #3608
Conversation
try | ||
{ | ||
// {"Version":6,"MessageType":"TestExecution.GetTestRunnerProcessStartInfoForRunAll","Payload":{ | ||
if (rawMessage[2] != 'V') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of range check for malformed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good idea. Would you check just for length 3, or for minimal size of what we consider valid message? Or probably does not make a difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you only check for size 3 you will need to do a similar check for 10
and 11
later on so I would check at least this size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am checking for minimal valid message size.
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/JsonDataSerializer.cs
Outdated
Show resolved
Hide resolved
try | ||
{ | ||
// {"Version":6,"MessageType":"TestExecution.GetTestRunnerProcessStartInfoForRunAll","Payload":{ | ||
if (rawMessage[2] != 'V') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you only check for size 3 you will need to do a similar check for 10
and 11
later on so I would check at least this size.
Description
Improve performance of deserialization and serialization.
For serialization we save a lot of time by not serializing into JToken and then to string.
And for deserialization the biggest impact is coming from not deserializing payloads into JTokens, and not deserializing them every time we inspect the header of the message.