]> arthur.barton.de Git - bup.git/commit
hashsplit: join buffers more efficiently
authorRob Browning <rlb@defaultvalue.org>
Fri, 29 Nov 2019 19:15:30 +0000 (13:15 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 29 Nov 2019 21:23:28 +0000 (15:23 -0600)
commitc2f10963fcaa6728bac8089c66d13f0961dcbf14
tree388887dc4d916e1831ce62acb1d283c9254d1778
parentd59342a561ac6153f7880a77f38c7843e50b85be
hashsplit: join buffers more efficiently

Drop buffer_concat in favor of join_bytes, since we can use b''.join()
to join the two put() chunks in python 3, which should be notably more
efficient than copying the memoryview bytes before joining them.

In python2, also use join when we just have bytes, otherwise
accommodate the fact that you can't join bytes and buffers there, and
you can't append bytes to a buffer.  The case we currently care about
should still end up being handled the same as befoere (in the first
clause), i.e. buf + bytes.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/compat.py
lib/bup/hashsplit.py