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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
            Reporter:
            Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: