We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I noticed some strange behavior when JSON.Serialize is called via anonymous function. Consider following benchmark:
JSON.Serialize
[MemoryDiagnoser] public class SerializersBenchmark { private Action<object> jilSerializer = o => JSON.Serialize(o, Options.ISO8601); private static readonly SomePerson Person = new SomePerson { FirstName = "John", LastName = "Doe" }; [Benchmark] public void JilSerializer() { JSON.Serialize(Person, Options.ISO8601); } [Benchmark] public void JilSerializerThroughAction() { jilSerializer(Person); } public class SomePerson { public string FirstName { get; set; } public string LastName { get; set; } } }
Here are results:
You can see significant performance reduction and increase of memory allocation. Could you please advise how to avoid it?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I noticed some strange behavior when
JSON.Serialize
is called via anonymous function. Consider following benchmark:Here are results:
You can see significant performance reduction and increase of memory allocation. Could you please advise how to avoid it?
The text was updated successfully, but these errors were encountered: