git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	git@vger.kernel.org,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Ralf Thielow" <ralf.thielow@gmail.com>
Subject: Re: [PATCH v2] macos: lazily initialize iconv
Date: Fri, 10 Aug 2012 23:11:34 +0200	[thread overview]
Message-ID: <50257906.1010606@web.de> (raw)
In-Reply-To: <7vsjbuk3v3.fsf@alter.siamese.dyndns.org>

On 10.08.12 20:18, Junio C Hamano wrote:
> Torsten Bögershausen <tboegi@web.de> writes:
>
>> On 31.07.12 20:37, Junio C Hamano wrote:
>>> In practice, the majority of paths do not have utf8 that needs
>>> the canonicalization. Lazily call iconv_open()/iconv_close() to
>>> avoid unnecessary overhead.
>>>
>>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>>> Helped-by: Ralf Thielow <ralf.thielow@gmail.com>
>>> Helped-by: Linus Torvalds <torvalds@linux-foundation.org>
>>> ---
>>>
>>>  * This is not even compile tested, so it needs testing and
>>>    benchmarking, as I do not even know how costly the calls to
>>>    open/close are when we do not have to call iconv() itself.
>>> ...
>> Hi Junio,
>>
>> thanks for the optimization.
>> Tested-by: Torsten Bögershausen <tboegi@web.de>
> Well, I didn't mean the correctness testing without numbers.  The
> correctness of the patch after a couple of people eyeballed it was
> no longer a question.
>
> If the patch does not give any measuable performance difference to
> people who exercise this codepath, it is not worth merging.  And
> that is not something I can't do myself without a Mac (nor I wish to
> have one to be able to do so myself).
>
> Thanks.
Really sorry for the confusion with the percentage, I should have written:
The patch is tested OK, and we can even remove 2 lines of code,
where we save and restore errno.
They are no longer needed.

Here some benchmarks on my system
(Intel Core 2 Duo @   3,06 GHz, L2-Cache:    3 MB,  Memory:    4 GB)
running git status on the linux source tree.

After cloning, I set "git config core.precomposeunicode true".

git is v1.7.12.rc2,
git_git/git is with your patch.

git v1.7.12.rc2:
tb@birne:~/projects/git/linux-2.6> for f in 1 2 3 4 5; do time git status  ; done 2>&1 | egrep "^user|^real|^sys"
real    0m0.469s
user    0m0.283s
sys     0m0.175s

real    0m0.461s
user    0m0.283s
sys     0m0.170s

real    0m0.460s
user    0m0.283s
sys     0m0.170s

real    0m0.461s
user    0m0.283s
sys     0m0.177s

real    0m0.460s
user    0m0.283s
sys     0m0.176s

With lazy init of iconv:
tb@birne:~/projects/git/linux-2.6> for f in 1 2 3 4 5; do time ~/projects/git/git_git/git status  ; done 2>&1 | egrep "^user|^real|^sys"
real    0m0.463s
user    0m0.282s
sys     0m0.173s

real    0m0.460s
user    0m0.281s
sys     0m0.172s

real    0m0.460s
user    0m0.281s
sys     0m0.172s

real    0m0.463s
user    0m0.281s
sys     0m0.175s

real    0m0.462s
user    0m0.281s
sys     0m0.177s

  reply	other threads:[~2012-08-10 21:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 17:52 [PATCH] macos: lazily initialize iconv Junio C Hamano
2012-07-31 18:07 ` Junio C Hamano
2012-07-31 18:10 ` Ralf Thielow
2012-07-31 18:19   ` Junio C Hamano
2012-07-31 18:37 ` [PATCH v2] " Junio C Hamano
2012-07-31 18:55   ` Ralf Thielow
2012-07-31 19:00     ` Junio C Hamano
2012-07-31 19:51   ` Linus Torvalds
2012-07-31 20:16     ` Junio C Hamano
2012-07-31 20:39       ` Linus Torvalds
2012-08-01 19:25         ` Torsten Bögershausen
2012-08-10 16:43   ` Torsten Bögershausen
2012-08-10 18:18     ` Junio C Hamano
2012-08-10 21:11       ` Torsten Bögershausen [this message]
2012-08-10 21:47         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50257906.1010606@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ralf.thielow@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).