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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: