submodule: rewrite `module_name` shell function in C
commit0ea306ef1701d6f42e74d3c33addfcd630248904
authorStefan Beller <sbeller@google.com>
Wed, 2 Sep 2015 21:42:25 +0000 (2 14:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Sep 2015 21:12:40 +0000 (3 14:12 -0700)
tree26fb1ee5833d5dba0e1da2c6b4b03a74d413c3fb
parent74703a1e4dfc5affcb8944e78b53f0817b492246
submodule: rewrite `module_name` shell function in C

This implements the helper `name` in C instead of shell,
yielding a nice performance boost.

Before this patch, I measured a time (best out of three):

  $ time ./t7400-submodule-basic.sh  >/dev/null
    real 0m11.066s
    user 0m3.348s
    sys 0m8.534s

With this patch applied I measured (also best out of three)

  $ time ./t7400-submodule-basic.sh  >/dev/null
    real 0m10.063s
    user 0m3.044s
    sys 0m7.487s

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
git-submodule.sh