msgpack-python icon indicating copy to clipboard operation
msgpack-python copied to clipboard

Allow users to specify Packer's internal buf_size

Open rtobar opened this issue 11 months ago • 7 comments

Giving this flexibility to users means that internal reallocations can be avoided if the buffer size is good enough, at the expense of potentially allocating more memory than needed. This, together with reusing a Packer object, means that multiple serialisations can end up requiring no memory allocations other than the initial buffer creation, which can be a big win in some situations.

The default value is still 1MB, making this backwards compatible.

rtobar avatar Jul 18 '23 13:07 rtobar