git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Johannes Sixt <j6t@kdbg.org>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: js/drop-mingw-test-cmp, was Re: What's cooking in git.git (Dec 2022, #03; Sun, 11)
Date: Tue, 27 Dec 2022 21:52:46 +0900	[thread overview]
Message-ID: <xmqqilhxt3dt.fsf@gitster.g> (raw)
In-Reply-To: 2a5433ae-ec48-0c24-c18e-9a415d29e590@web.de

René Scharfe <l.s.r@web.de> writes:

> Logged the sizes of files handed to test_cmp (on macOS).  19170 calls,
> median size 42 bytes, average size 617 bytes.  2307 calls with empty
> files, 1093 of which in t1092 alone.  The two biggest files in t1050,
> 2000000 and 2500000 bytes.  t9300 in third place with 180333, one
> magnitude smaller.
>
> t1050 at 8a4e8f6a67 (The second batch, 2022-12-26) on Windows:
>
> Benchmark 1: sh.exe t1050-large.sh
>   Time (mean ± σ):     18.312 s ±  0.069 s    [User: 0.000 s, System: 0.003 s]
>   Range (min … max):   18.218 s … 18.422 s    10 runs
>
> ... and with the patch:
>
> Benchmark 1: sh.exe t1050-large.sh
>   Time (mean ± σ):      5.709 s ±  0.046 s    [User: 0.000 s, System: 0.003 s]
>   Range (min … max):    5.647 s …  5.787 s    10 runs
>
> So it works as advertised for big files, but calling an external
> program 19000 times takes time as well, which explain the longer
> overall test suite duration.
>
> If we use test_cmp_bin for the two biggest comparisons we get the
> same speedup:
>
> Benchmark 1: sh.exe t1050-large.sh
>   Time (mean ± σ):      5.719 s ±  0.089 s    [User: 0.000 s, System: 0.006 s]
>   Range (min … max):    5.659 s …  5.960 s    10 runs
>
> Is this safe?  The files consist of X's and Y's at the point of
> comparison, so they aren't typical binary files, but they don't
> have line endings at all or any user-readable content, so I think
> treating them as blobs is appropriate.

Nice analysis.

If we can use the platform "diff -u" (i.e. we somehow find that it
is possible to stop ignoring crlf vs lf difference), then it should
give us similarly good performance for large files (but the cost to
spawn the tool 19000 times would also be comparable), but we are not
there yet, I presume.

      reply	other threads:[~2022-12-27 12:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11  5:18 What's cooking in git.git (Dec 2022, #03; Sun, 11) Junio C Hamano
2022-12-12  7:50 ` js/drop-mingw-test-cmp, was " Johannes Schindelin
2022-12-12 21:43   ` Junio C Hamano
2022-12-20 22:59     ` Johannes Schindelin
2022-12-21 13:05       ` Junio C Hamano
2022-12-24  8:10         ` Johannes Sixt
2022-12-24 13:31           ` René Scharfe
2022-12-25 14:45             ` Junio C Hamano
2022-12-25 15:44             ` Johannes Sixt
2022-12-26 19:53               ` René Scharfe
2022-12-27 12:52                 ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqilhxt3dt.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=l.s.r@web.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).