[CSHARP-1067] ObjectId could have a slightly smaller internal representation Created: 16/Sep/14 Updated: 20/Jan/16 Resolved: 10/Aug/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | 2.1 |
| Type: | Improvement | Priority: | Major - P3 |
| 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 |
|
An ObjectId is 12 bytes long, but our current implementation:
means that 14 bytes are used. (two fields, _machine and _increment, are 1 byte larger than they need to be). We could instead represent the 12 bytes internally as:
Which is exactly 12 bytes. We could easily reimplement the Timestamp, MachineId, Pid and Increment properties to extract the necessary bytes from _a, _b and _c and synthesize the corresponding return value, so this would not be a backward breaking change. |
| Comments |
| Comment by Githook User [ 10/Aug/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Githook User [ 10/Aug/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |
| Comment by Githook User [ 10/Aug/15 ] |
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: |