[CSHARP-1092] Optimize output of BSON arrays by caching index names Created: 03/Nov/14  Updated: 15/Nov/14  Resolved: 15/Nov/14

Status: Closed
Project: C# Driver
Component/s: BSON
Affects Version/s: 1.9.2
Fix Version/s: 2.0

Type: Improvement Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently when BSON arrays are output the names of the indexes (as required by the BSON spec) are computed by calling Int32.ToString and then encoding the string to UTF8.

It should be considerably faster to cache the UTF8 values of commonly used index names (say the first 1000 or so).



 Comments   
Comment by Githook User [ 15/Nov/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1092: Added a missing test for ArrayElementNameAccelerator.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/c71dd3eb04d8af0e3abbdfbc8f48c3b6bf9e323d

Comment by Githook User [ 15/Nov/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1092: Added tests for ArrayElementNameAccelerator.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/ceff4059e4269bb3349e2d0008015d2edcb5b0da

Comment by Githook User [ 15/Nov/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1092: Optimize writing BSON arrays by caching UTF8 element names for frequently used index values.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/40de79a925f32367fecb0abd0d20f15884ab761c

Generated at Wed Feb 07 21:38:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.