Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1116

Support alternate strategies for input and output buffers

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None

      The requirements for input and output buffers are sufficiently different that it would be good to support alternate strategies for each of the two directions.

      For input buffers:

      • the total required size is known in advance
      • for very small buffers it would be better to just allocate one from the heap
      • for larger buffers, we can optimize the sizes of the segments given that we know the total size required in advance

      For output buffers:

      • the total size is NOT known in advance
      • most messages will end up being small, but we can't tell in advance
      • so we should start with a single relatively small segment (1K?) allocated from the heap
      • if that turns out to be enough, great, otherwise start grabbing increasingly larger segments from an underlying source (presumably pooled)

      Note: this would not require any new interfaces, just alternate implementations of the IBsonChunkSource interface proposed in CSHARP-1115.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: