mongo-csharp-driver
mongo-csharp-driver copied to clipboard
CSHARP-2456: Use explicit function instead of anonymous
Anonymous function has to capture 'this' as well as parameter since it calls object instance method.
Each invocation ended allocating 32 bytes, sample print:
0000028151aca4c0 (MongoDB.Bson.IO.BsonWriter+<>c__DisplayClass44_0)
<>4__this:0000028151ac8fd0 (MongoDB.Bson.IO.JsonWriter)
name:000002824ee886b0 (System.String) Length=11, String="_odata_type"
Function is called super-often, memory snapshots indicate ~1M instances are leaving in the heap.
@craiggwilson, @rstam
Hi folks, please take a look at a small performance pill.
Thanks.
@rstam, @craiggwilson its been a month since PR creation time =/
Could you please review this tiny change?
@vincentkam - seem you've participated in the last completed PR in the repo, could you please take a look at this one as well?
Thanks.
Hi @mitikov, thanks for opening this pull request, and my apologies for the delay in response here. The MongoDB .NET team relies primarily on our JIRA project to track and prioritize our work.
In order to continue the conversation, can you please open a ticket at the above link so we can discuss your proposal there?
Hi @mitikov, thanks for this pull request and our apologies for the very late feedback here. We implemented this change as part of another PR: https://github.com/mongodb/mongo-csharp-driver/pull/1265 that was changing the same code area and did see any actual performance improvements worth the changes. So we will close this PR and associated ticket.
This PR was actually included as part of PR https://github.com/mongodb/mongo-csharp-driver/pull/1290
Thank you for submitting it.