-
Notifications
You must be signed in to change notification settings - Fork 47
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
Performace issue #375
Comments
Wow yes @aspektxxx lambda compile time is expensive and it should be caching this. Are you able to reduce the possible culprits by removing some of the configurations above? Or are you saying the above configurations for sure cause the performance pain you are experiencing? |
Also I am glad to hear you are using a complex scenario and it isn't exploding at first sight. 😁😆 |
@Mike-EEE well, that's the problem, I'm unable to reduce it as its too complex. Till now I was unable to prepare repro steps as all simpler examples works like a charm. I was hoping that you might have some clue what can be possible root cause. I will look more thoroughly into it next week and try to prepare repro. |
OK thank you for the additional information @jhranac. Just so we remove one element here... I would like to verify how the serializer is being created and how the serializer is being used. The serializer should be a singleton (or scoped) object that is created once (where all the setup and caching occurs), and then its Can you confirm that you are following this approach? That is, the serializer isn't being created at the time of the serialization and has been created beforehand (preferably during application initialization)? |
We're using 3 instances of the serializer in the whole application (they have slightly different configuration based on usage). All of them are singletons and live for the whole lifetime of the application, never to be disposed/re-created. They do not cross-reference each other or use custom serializers to mix the usage. Always using just the one for the job. |
ALRIGHT... crossing that off my list here. The next checkdown I spy is the use of Are you able to perhaps try a quick scenario without the use of |
Doh... we indeed have some funny business going on here. It looks like caching simply is not working at all. :| Looking into this now. |
Alright there was a place where indeed lambda compilation was occurring twice. I am not convinced this addresses the full problem but it's a start. Please find the build details here: We'll see how that does as a first step. 🤞 |
We're using the optimized namespaces - which in retrospect makes no sense in some of the cases so I'll remove that. That should fix some of the performance issues for us. Performance times - 100 iterations run to get an average. Times format: [serialize 1 element in array] / [serialize 100 elements in array] in milliseconds
So the fix you've done works! |
OK @jhranac I think I got it. 😁 I removed the check for type members if a custom serializer is present. All tests still pass, so... let's see. |
The timings look much better now!
I'm happy with those results. Good job! |
SWEET! It's the little things in life ATM. 😅 I will merge this in and then shoot for next Tuesday for a release to NuGet. 👍 |
Welp, tried to deploy this but we are having a little trouble with GitHub Actions: I have a ping out to support, we'll see what's up.
|
Alright, looks like the issue is with a dependency having to deal with PowerShell 7, which for some reason was auto-updated without confirmation in GitHub Action images. 🤷♂️ They are aware of it and looking into it: We'll proceed once there's a fix. Sit tight with the preview feed in the meantime. 👍 |
Also being tracked here: |
FINALLY... got this sucker out: Please let me know if you run into any problems. Thank you for your efforts towards improving ExtendedXmlSerializer. 👍
|
Hi @Mike-EEE, I'm experiencing a performance issue when trying to serialize pretty complex object with few dozens of items with custom serializer in list. Currently I'm unable to pinpoint it to the root cause and prepare the repro sample. However, profiler show a 25% time is spend in
SetterFactory:39 lambda.Compile();
the serialize is created with
Any idea what could be root cause?
The text was updated successfully, but these errors were encountered: