Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3449

Implement buffer.h in terms of PyByteArray in order to avoid memory copy

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 4.10
    • Affects Version/s: None
    • Component/s: None
    • None

      bernie@mongodb.com had the idea to re-implement buffer.h in terms of PyByteArray in order to avoid the big memory copy at the end of BSON encoding. The C api methods would return bytearray instead of bytes.

      https://docs.python.org/3/c-api/bytearray.html
      https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_Resize
      https://docs.python.org/3/c-api/bytearray.html#c.PyByteArray_AsString

            Assignee:
            Unassigned Unassigned
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: