Support alternate buffer pool strategies

XMLWordPrintableJSON

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

      We use a buffer pool to hold buffers uses during I/O (i.e. sending and receiving message). Using a buffer pool helps reduce the amount of work the garbage collection must do.

      We currently have a single static ByteBufferFactory which gets its chunks from exactly one kind of pool, a BsonChunkPool.

      It would be good to abstract the notion of a buffer pool to an interface to enable us to have multiple implementations.

      This interface could look like:

      public interface IBsonChunkSource : IDisposable
      {
          IBsonChunk GetChunk(int requestedSize);
      }
      

      What are actually pooled are chunks, not entire buffers, which are made up of multiple chunks.

      I think it's better that the name of the interface not include the word "Pool", since the source may or may not involve a pool.

            Assignee:
            Robert Stam (Inactive)
            Reporter:
            Robert Stam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: