[GODRIVER-1683] Add a reflection-free opt-in bson.D encoder Created: 10/Jul/20  Updated: 28/Oct/23  Resolved: 27/Jul/20

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Improvement Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Epic Link: GODRIVER-1587

 Description   

The existing codepath for marshalling a bson.D requires looking up registry entries for each element. We can optimize away these registry lookups by adding an opt-in encoder that treats bson.D as a closed type system and only marshals a small set of types (e.g. basic scalar types + the ones in the primitive package) and errors for others (e.g. if one of the document values is a struct). This encoder should live in x/bsonx and should not be registered by default.



 Comments   
Comment by Githook User [ 27/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1683 Add reflection-free encoder for bson.D (#466)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/ec900457b07564260c439ea2de362521f03efbf9

Comment by Divjot Arora (Inactive) [ 22/Jul/20 ]

https://github.com/mongodb/mongo-go-driver/pull/466

Generated at Thu Feb 08 08:36:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.