Bug report
Bug description:
CPython PR #17757 allowed the GIL to be released during b"".join() operations. However, this optimization currently only triggers if every passed object is of type bytes; it falls back to acquiring the GIL if it encounters mutable buffers. While reacquiring the GIL is necessary for mutable types like bytearray, we can still safely drop the GIL for memoryview objects that expose immutable bytes.
Please refer to fsspec/gcsfs#795 (comment) for more context.
cc: @martindurant
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Bug report
Bug description:
CPython PR #17757 allowed the GIL to be released during b"".join() operations. However, this optimization currently only triggers if every passed object is of type bytes; it falls back to acquiring the GIL if it encounters mutable buffers. While reacquiring the GIL is necessary for mutable types like bytearray, we can still safely drop the GIL for memoryview objects that expose immutable bytes.
Please refer to fsspec/gcsfs#795 (comment) for more context.
cc: @martindurant
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux