Skip to content
  • Arnd Bergmann's avatar
    kbuild: speed up checksyscalls.sh · d21832e2
    Arnd Bergmann authored
    
    
    checksyscalls.sh is run at every "make" run while building the kernel,
    even if no files have changed. I looked at where we spend time in
    a trivial empty rebuild and found checksyscalls.sh to be a source
    of noticeable overhead, as it spawns a lot of child processes just
    to call 'cat' copying from stdin to stdout, once for each of the
    over 400 x86 syscalls.
    
    Using a shell-builtin (echo) instead of the external command gives
    us a 13x speedup:
    
        Before		   After
    real	0m1.018s       real	0m0.077s
    user	0m0.068s       user	0m0.048s
    sys	0m0.156s       sys	0m0.024s
    
    The time it took to rebuild a single file on my machine dropped
    from 5.5 seconds to 4.5 seconds.
    
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    d21832e2