After an update in Debian 10, the PDF viewer Atril (a fork of Evince) takes about 25 seconds to launch even with no document. Previously it was almost instantaneous. Now I need to find out what causes this delay. When I run Atril through the strace command, it pauses at different system calls each time so I cannot draw any conclusions from that. Next I built Atril from source and run it in the gdb debugger but there I can only see a couple of threads being created and exited. How can I find out where in the source code the delay is?
1 Answers
You could run the program in the debugger and then interrupt it a few times using Ctrl+C. Each time, use where
or bt
to see where you are in the execution. There is a good explanation of this approach here. You probably want to enable debugging symbols when compiling (GCC: -g
). Also, the compiled code can differ significantly from your original source code if you have optimizations turned on, so it might make sense to only use a debugging optimization level (GCC: -Og
).
If there is a single step that causes this huge delay, this should allow you to instantly identify it.
Otherwise, you could check out other answers of this question. Profiling tools on linux include valgrind and the perf tools.
For perf, keep in mind that the sampling based approach could mislead you if your program is actually not executing, but waiting, e.g. for IO.

- 3,263
- 1
- 12
- 31