# for i in `seq 10`; do time git status; done
# On branch minix-master
nothing to commit, working directory clean
git status 0.17s user 0.13s system 99% cpu 0.302 total
git status 0.20s user 0.10s system 99% cpu 0.307 total
git status 0.20s user 0.10s system 98% cpu 0.305 total
git status 0.18s user 0.12s system 98% cpu 0.300 total
git status 0.15s user 0.15s system 98% cpu 0.301 total
git status 0.16s user 0.14s system 98% cpu 0.301 total
git status 0.18s user 0.13s system 98% cpu 0.307 total
git status 0.18s user 0.12s system 99% cpu 0.302 total
git status 0.15s user 0.14s system 98% cpu 0.301 total
git status 0.16s user 0.14s system 98% cpu 0.301 total
NOTES:
- there is small differences between systems, ~0.2s vs. ~0.6s vs. 10.5s
- netbsd on virtualbox performance is good (no experience of native performance though)
- filesystems are different on each machine: ext4 (linux), ffs (netbsd), mfs (minix) if/when it make any meaningful difference in this test case.
- git versions different
- netbsd/linux amd64 versions (64-bit)
A quick strace what is happening on linux.
# strace -f -c git status
# On branch minix-master
nothing to commit, working directory clean
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
46.25 0.001246 0 72311 12 lstat
33.41 0.000900 0 33117 getdents
9.99 0.000269 0 16603 16563 open
5.35 0.000144 0 16599 close
5.01 0.000135 0 16558 openat
0.00 0.000000 0 57 read
0.00 0.000000 0 2 write
0.00 0.000000 0 17 5 stat
0.00 0.000000 0 30 fstat
0.00 0.000000 0 4 lseek
0.00 0.000000 0 48 mmap
0.00 0.000000 0 12 mprotect
0.00 0.000000 0 20 munmap
0.00 0.000000 0 235 brk
0.00 0.000000 0 7 rt_sigaction
0.00 0.000000 0 1 rt_sigprocmask
0.00 0.000000 0 1 ioctl
0.00 0.000000 0 31 20 access
0.00 0.000000 0 1 execve
0.00 0.000000 0 8 fcntl
0.00 0.000000 0 5 getcwd
0.00 0.000000 0 5 chdir
0.00 0.000000 0 1 unlink
0.00 0.000000 0 1 1 readlink
0.00 0.000000 0 2 getrlimit
0.00 0.000000 0 1 arch_prctl
0.00 0.000000 0 1 1 futex
0.00 0.000000 0 1 set_tid_address
0.00 0.000000 0 1 set_robust_list
------ ----------- ----------- --------- --------- ----------------
100.00 0.002694 155680 16602 total
So, most of time spent is used to walk trough file system, as expected.
It is dangerous to make assumptions but I still do assume that lstat and getdents (readdir) syscalls are the major bottlenecks also in minix3.
There is over 100k calls just for these two functions.
It would be interesting information to know how much time is spent in VFS/MFS code vs. sending messages in and out.
- janne kiiski