summaryrefslogtreecommitdiff
path: root/sideband.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-21 11:14:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-24 02:12:31 (GMT)
commitcc5e1bf992470e0d514c743e75a0325c8b592f38 (patch)
treefd7272b20100456d93a4ee728ef477c935a2c0f0 /sideband.c
parent86e254584bb466aaf1bacbdf4a1ade924c8bdbe9 (diff)
downloadgit-cc5e1bf992470e0d514c743e75a0325c8b592f38.zip
git-cc5e1bf992470e0d514c743e75a0325c8b592f38.tar.gz
git-cc5e1bf992470e0d514c743e75a0325c8b592f38.tar.bz2
gettext: avoid initialization if the locale dir is not present
The runtime of a simple `git.exe version` call on Windows is currently dominated by the gettext setup, adding a whopping ~150ms to the ~210ms total. Given that this cost is added to each and every git.exe invocation goes through common-main's invocation of git_setup_gettext(), and given that scripts have to call git.exe dozens, if not hundreds, of times, this is a substantial performance penalty. This is particularly pointless when considering that Git for Windows ships without localization (to keep the installer's size to a bearable ~34MB): all that time setting up gettext is for naught. To be clear, Git for Windows *needs* to be compiled with localization, for the following reasons: - to allow users to copy add-on localization in case they want it, and - to fix the nasty error message BUG: your vsnprintf is broken (returned -1) by using libgettext's override of vsnprintf() that does not share the behavior of msvcrt.dll's version of vsnprintf(). So let's be smart about it and skip setting up gettext if the locale directory is not even present. Since localization might be missing for not-yet-supported locales, this will not break anything. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sideband.c')
0 files changed, 0 insertions, 0 deletions