Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1683

Add a reflection-free opt-in bson.D encoder

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: BSON
    • None

      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.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: