-
Notifications
You must be signed in to change notification settings - Fork 18
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
Performance #92
Comments
In ObjectWriter.cs - TouchAndWriteAssemblyId if(assemblyIndices.ContainsKey(assembly))
{
assemblyId = assemblyIndices[assembly]; Changing that into a [Edit] |
I've got the total time down to 0.898 sec now. it turns out that the Equality comparison for AssemblyDescriptor uses string join and some linq to generate the FullName of the assembly, the full name is then used in the equality comparison. |
Hi roger, |
Normally the heavy process you're mainly profiling now is done only once per type (so in case of 100000 instances the time it takes in negligible). |
Nonetheless your findings are still interesting and will be analyzed (you can even post a pull request if you'd like to). |
I've modified your test snippet according to what I've written above. Look at it here: https://gist.github.com/konrad-kruczynski/2636b9c2eaa37961c38b Please run it and tell me whether it suits your needs. Note that the open stream mode is not yet as optimized as the "all the stuff in one call" one, but can be tweaked. |
I've used your |
By temporary removing stamping (just as an experiment now, not the final version) I was able to get down from 4.1s to 0.45s on my PC (your unmodified tests). So it will definitely be a way to go. |
I created a separate issue on creating an option to disable type stamping: #98. |
Hi,
I have been comparing the perf of Migrant with Json.NET today and the results were a bit on the weak side.
It turned out that Migrant is about 24 times slower than Json.NET.
I do get that there is more data to handle with Migrant as it includes a lot more in the payload than json.net does.
Here is a is a screenshot of a profiling session:
And here is the (extremely naive) perf test I used https://gist.github.com/rogeralsing/7b57167935ce048859e7
The test is designed to simulate what we do in Akka.NET, thus the byte array stuff in there.
According to the profiling session, it does look like there is a specific method that is responsible for most of the cpu consumption,
TouchAndWriteAssemblyId
Are there any settings that can omit some of the expensive information from the payload or are the default settings the fastest?
The text was updated successfully, but these errors were encountered: