git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH 1/5] gettext: fix bug in git-sh-i18n's eval_gettext() by using envsubst(1)

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 9, 2010, 12:38 UTC
Message-ID
<AANLkTiny+NmXew6UxjNMO+o75=CxxWm9iVRMRxs0LyTJ@mail.gmail.com>
In-Reply-To
<4CD93CF2.2060800@viscovery.net>
On Tue, Nov 9, 2010 at 13:22, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 16 quoted lines
> Am 11/9/2010 12:57, schrieb Ævar Arnfjörð Bjarmason:
>> How about if you just replace your tests with "cat". That should give
>> a more accurate indication of what speed it *should* be operating at,
>> once I fix those Makefile issues.
>
> Just FYI:
>
> $ time (for i in {1..100}; do eval_gettext2 foobar; done) > /dev/null
>
> real    0m14.844s
> user    0m11.635s
> sys     0m4.372s
>
> Please understand that on Windows there is a difference between cat, sed,
> etc. and git. There is also a speed difference, which is annoying, but it
> is fact and *not* a bug. You cannot argue with how the timings "should be".
I don't know/use Windows, or Git on Windows. So forgive my ignorance.

I understood your previous comments to mean that the invocation time of git-* on one hand and cat(1) on the other hand had to do with how many DLL's the former needed.

Since git-sh-i18n--envsubst needs the same DLL's (i.e. the libc) as cat(1) and *nothing else* it should be as fast as cat(1) and not as slow as git-*(1) once I fix that unfortunate Makefile bug, right?

Or is it something to do with the built-in MinGW tools being special in some way (e.g. preloaded?)? In that case benchmarking a hello-world.c for a git-sh-i18n--envsubst (or fixing the linking of git-sh-i18n--envsubst) would make for a better comparison.

Show 7 quoted lines
>> Anyway, if it's no more expensive than cat(1) (which it shouldn't be)
>> it probably won't be a problem to use git-sh-i18n--envsubst.
>
> It *is* more expensive.
>
> BTW, current ab/i18n fails to compile when NO_GETTEXT is specified in
> config.mak and libintl.h is not available. I suggest the fix below.

We already discussed this back in August. I came up with what I thought was a more elegant solution, but didn't implement it yet: http://www.spinics.net/lists/git/msg137783.html

I can try to come up with one (next weekend or something) and CC it to you for testing.

Show 33 quoted lines
> diff --git a/Makefile b/Makefile
> index c55baa6..e9ee142 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -619,9 +619,6 @@ LIB_OBJS += entry.o
>  LIB_OBJS += environment.o
>  LIB_OBJS += exec_cmd.o
>  LIB_OBJS += fsck.o
> -ifndef NO_GETTEXT
> -LIB_OBJS += gettext.o
> -endif
>  LIB_OBJS += graph.o
>  LIB_OBJS += grep.o
>  LIB_OBJS += hash.o
> @@ -1539,7 +1536,8 @@ endif
>
>  ifdef NO_GETTEXT
>        COMPAT_CFLAGS += -DNO_GETTEXT
> -endif
> +else
> +       LIB_OBJS += gettext.o
>
>  ifdef NEEDS_LIBINTL
>        EXTLIBS += -lintl
> @@ -1552,6 +1550,7 @@ endif
>  ifdef GETTEXT_POISON
>        COMPAT_CFLAGS += -DGETTEXT_POISON
>  endif
> +endif
>
>  ifeq ($(TCLTK_PATH),)
>  NO_TCLTK=NoThanks
>
Previous: Johannes SixtNext: Johannes Sixt
Message 21 of 27 in “Buglet in i18n?”
  1. Johannes SixtOct 22, 2010
  2. Ævar Arnfjörð BjarmasonOct 22, 2010
  3. Jonathan NiederOct 22, 2010
  4. Ævar Arnfjörð BjarmasonOct 23, 2010
  5. Johannes SixtOct 22, 2010
  6. Ævar Arnfjörð BjarmasonOct 30, 2010
  7. 0/5 ab/i18n: Things I'll add in the next iterationÆvar Arnfjörð Bjarmason, Oct 31, 2010
  8. 1/5 gettext: fix bug in git-sh-i18n's eval_gettext() by using envsubst(1)Ævar Arnfjörð Bjarmason, Oct 31, 2010
  9. Johannes SixtNov 2, 2010
  10. Ævar Arnfjörð BjarmasonNov 8, 2010
  11. Johannes SixtNov 9, 2010
  12. Ævar Arnfjörð BjarmasonNov 9, 2010
  13. Johannes SixtNov 9, 2010
  14. Ævar Arnfjörð BjarmasonNov 9, 2010
  15. Johannes SixtNov 9, 2010
  16. Erik Faye-LundNov 9, 2010
  17. Ævar Arnfjörð BjarmasonNov 9, 2010
  18. Johannes SixtNov 9, 2010
  19. Ævar Arnfjörð BjarmasonNov 9, 2010
  20. Johannes SixtNov 9, 2010
  21. Ævar Arnfjörð BjarmasonNov 9, 2010
  22. Johannes SixtNov 9, 2010
  23. Ævar Arnfjörð BjarmasonNov 9, 2010
  24. 2/5 gettextize: git-clone: !fixup "basic messages"Ævar Arnfjörð Bjarmason, Oct 31, 2010
  25. 3/5 gettextize: git-init: !fixup "basic messages"Ævar Arnfjörð Bjarmason, Oct 31, 2010
  26. 4/5 gettextize: git-revert: !fixup "Your local changes"Ævar Arnfjörð Bjarmason, Oct 31, 2010
  27. 5/5 gettextize: git-merge: !fixup "basic messages"Ævar Arnfjörð Bjarmason, Oct 31, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.