On Tue, Sep 07, 2021 at 03:11:15PM -0500, David Gene wrote:
> I also experience slow startup times. For example, if I open the Atom
> <https://atom.io> .deb,
Thanks for the sample, the last release is 132.3M 2022-03-08  atom-amd64.deb

> gdebi-gtk takes about 10 seconds to show the package
> into and become responsive.
I can repro the timing.

Interestingly, running gdebi-gtk, then ^O, and selecting the package
leaves the UI dimmed with a "Loading..." note at the bottom.
("Loading..." is inconsistent, but the UI is dimmed so it's okay.)

Running gdebi-gtk atom-amd64.deb shows the "Loading..." thing for like a
second and the UI is never dimmed.

> In contrast, command line gdebi only takes about
> a second. So there is probably potential to speed up startup in general.
strace gdebi-gtk shows that during the loading stage, it's in a tight
  read(64, ..., 4096)
loop (with occasional reallocations).

So this is very much the case. breaking on read(2) shows
  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 ()
so this may be a win for everyone :)

(Bumping the buffer to 64k buys ~2.2s:
   https://salsa.debian.org/apt-team/apt/-/merge_requests/380)

Attachment: signature.asc
Description: PGP signature

Reply via email to