[CSHARP-4306] Performance optimization for class and collections deserialization Created: 02/Sep/22 Updated: 08/Jun/23 |
|
| Status: | Backlog |
| Project: | C# Driver |
| Component/s: | BSON, Performance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Unknown |
| Reporter: | Aleksei Troepolskii | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | Improve Serialization | ||||||||||||
| Description |
|
Class deserializer has many work with reflection, set properies produces boxing, has many loop checks and so on... Collection deserializer always create new list after deserialization insead of return ready one. And again - REFLECTION. I solve this problem and get about 35% perf up in my cases with huge dto objects: https://github.com/mongodb/mongo-csharp-driver/pull/871
Links: 1) PR: https://github.com/mongodb/mongo-csharp-driver/pull/871 2) Test Project: https://github.com/troepolik/testMongoDBPerformance just set reference to BSON project, sure you set release mode and run, and press to repeate several times to see statistics, then switch to my optimized project. Sugestion: press repeat in moment when CPU% is low. |
| Comments |
| Comment by Boris Dogadov [ 17/Oct/22 ] |
|
Hello aleksei.troepolskii@altenar.com , thank you for your research and the PR. |