Deprecate bson.NewDocumentReader

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      GODRIVER-2976 changed the raw bytes pattern used by the bson.valueReader to use a standard library io.Reader implementation, which supports streaming. We've had users note that this introduces a performance regression, notably due to allocations required in the lower-level unexported read* operations. PR #2120 proposes that we create two byte sources for value reader: one for buffers to be used as an under-the-hood optimization and one for streaming to avoid a breaking change.

      Definition of done

      We should decide if we want to maintain both buffered and streaming valueReader solutions in V3. If so, we should deprecate bson.NewDocumentReader and add the following constructors:

      • bson.NewBufferedDocumentReader
      • bson.NewStreamingDocumentReader

      Pitfalls

      Ideally we would only have one bytes provider for valueReader.

            Assignee:
            Unassigned
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: