Process creation time, shell script and system call overhead
5
votes
3
answers
2209
views
I have a machine dual booted with Arch Linux and Ubuntu (16.04).
I have recently started using the Kakoune text editor , and noticed that its startup time is drastically different depending on which OS I am using. However I believe the underlying problem is **not** due to kakoune directly.
On startup, kakoune runs a bunch of shell scripts to enable integration with x11 and tmux, git, syntax highlighting/colorschemes, etc. This can be disabled to just load the 'vanilla' editor using the
-n
flag.
The command: kak -e q
will start kakoune, run all startup scripts and exit immediately.
On Arch:
time kak -e q
takes **1 second**
time kak -n -e q
(no shell scripts) finishes in under **20 millis**.
On Ubuntu:
time kak -e q
takes about **450 millis**
time kak -n -e q
is again under **20 millis**
After trimming the fat and removing some of the startup scripts I did see an improvement on both OS's proportional to the amount removed.
I ran some benchmarks with UnixBench and found that the major differences between the two systems are seen in the 'process creation' and 'shell scripts' tests.
> The shells scripts test measures the number of times per minute a process can start and reap a set of one, two, four and eight concurrent copies of a shell scripts where the shell script applies a series of transformation to a data file.
Here is the relevant output. Units in 'loops per second' more is better:
Process creation (1 parallel copy of tests)
Arch: 3,822
Ubuntu: 5,297
Process creation (4 parallel copies of tests)
Arch: 18,935
Ubuntu: 30,341
Shell Scripts (1 concurrent) (1 parallel copy of tests)
Arch: 972
Ubuntu: 5,141
Shell Scripts (1 concurrent) (4 parallel copies of tests)
Arch: 7,697
Ubuntu: 24,942
Shell Scripts (8 concurrent) (1 parallel copy of tests)
Arch: 807
Ubuntu: 2,257
Shell Scripts (8 concurrent) (4 parallel copies of tests)
Arch: 1,289
Ubuntu: 3,001
As you can see the Ubuntu system performs much better.
I have tested using different login shells, terminal emulators, recompiling kakoune, removing unneeded software to clean up the disk, etc. I am certain this is the bottleneck.
**My question is:** what can I do to further investigate this and improve performance of the Arch Linux system to match Ubuntu? Should I look into tuning the kernel?
Additional notes:
- both systems use the same type of filesystem (ext4)
- I tend to use the Archlinux system more, and have noticed performance degrading over time
- Arch is on /dev/sda1 and is ~200GB. Ubuntu is on /dev/sda2, ~500GB. 1TB HDD.
- Arch uname -a
: Linux ark 4.14.13-1-ARCH #1 SMP PREEMPT Wed Jan 10 11:14:50 UTC 2018 x86_64 GNU/Linux
- Ubuntu uname -a
: Linux sierra 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Thanks
Asked by anon777
(63 rep)
Jan 20, 2018, 06:31 AM
Last activity: Jan 20, 2018, 08:46 PM
Last activity: Jan 20, 2018, 08:46 PM