LzmaFileFdPrivate: bump I/O buffer from 4k to 64k
In #924761, the package reading times are really high. The main thing in strace is read(64, ..., 4096) with a backtrace of
Thread 1 "python3" hit Breakpoint 1.7, __GI___libc_read (fd=64, buf=0x19f6820, nbytes=4096) at ../sysdeps/unix/sysv/linux/read.c:26
26 in ../sysdeps/unix/sysv/linux/read.c
(gdb) bt
#0 __GI___libc_read (fd=64, buf=0x19f6820, nbytes=4096) at ../sysdeps/unix/sysv/linux/read.c:26
#1 0x00007ffff7d22220 in __GI__IO_file_xsgetn (fp=0xecce20, data=<optimized out>, n=4096) at ./libio/libioP.h:947
#2 0x00007ffff7d17715 in __GI__IO_fread (buf=0x19f6820, size=1, count=4096, fp=0xecce20) at ./libio/iofread.c:38
#3 0x00007ffff6e58de1 in ?? () from /lib/x86_64-linux-gnu/libapt-pkg.so.6.0
#4 0x00007ffff6e533eb in FileFd::Read(void*, unsigned long long, unsigned long long*) () from /lib/x86_64-linux-gnu/libapt-pkg.so.6.0
#5 0x00007ffff6e4f517 in ExtractTar::Go(pkgDirStream&) () from /lib/x86_64-linux-gnu/libapt-pkg.so.6.0
#6 0x00007ffff5679619 in ?? () from /usr/lib/python3/dist-packages/apt_inst.cpython-311-x86_64-linux-gnu.so
#7 0x00000000005230d0 in ?? ()
#8 0x000000000053ac2c in PyObject_Vectorcall ()
After modifying gdebi-gtk to crash after startup (averages over 3 runs):
$ time PYTHONPATH=. python3 ./gdebi-gtk atom-amd64.deb
TypeError: exceptions must derive from BaseException
real 0m15.250s
user 0m14.170s
sys 0m00.881s
$ time PYTHONPATH=. LD_LIBRARY_PATH=/home/nabijaczleweli/uwu/apt/build/apt-pkg/ python3 ./gdebi-gtk atom-amd64.deb
TypeError: exceptions must derive from BaseException
real 0m13.097s
user 0m12.052s
sys 0m00.823s
so this is a 2.2s win on
$ wget https://github.com/atom/atom/releases/download/v1.60.0/atom-amd64.deb
$ l atom-amd64.deb
-rw-r--r-- 1 nabijaczleweli users 132.3M 2022-03-08 atom-amd64.deb
$ ar t atom-amd64.deb
debian-binary
control.tar.xz
data.tar.xz
Bumping the buffer to 1M averages to
real 0m12.707s
user 0m11.833s
sys 0m00.732s
(2.5s gain) so this is basically a wash and LZMA overpowers any further gains.