git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [RFC/PATCH v2 0/1] cygwin: fast stat functions
@ 2013-07-10 20:19 Ramsay Jones
  0 siblings, 0 replies; only message in thread
From: Ramsay Jones @ 2013-07-10 20:19 UTC (permalink / raw)
  To: mhagger
  Cc: Junio C Hamano, Jeff King, Johannes Sixt, Shawn O. Pearce,
	tboegi, mlevedahl, dpotapov, GIT Mailing-list


If you are wondering, v1 of this patch was appended to an email
that is part of the "cygwin: Remove the Win32 l/stat() functions"
thread.

Changes from v1:

    - add comment in git-compat-util.h to explain the use
      of the "fast" stat variants.
    - remove the fast_stat() function, along with the now
      redundant code in compat/cygwin.c
    - add the fast_fstat() function; this is used by code
      in write_entry() (entry.c:139), even though it is not
      actually called by cygwin.
    - replaced an additional call to lstat with fast_lstat.
    - a commit message

This patch, which was built on master @ commit 56df44a, has passed
the full test suite:

    $ GIT_SKIP_TESTS='t0008 t0061.3 t0070.3 t4130 t9010 t9300' \
        make test >test-outp15 2>&1
    $

After Torsten's patch, I didn't need to skip t0070.3; that was just
force of habit! Once Mark's PIPE prerequisite patch is applied, I
would not have to skip t0008, t9010 and t9300.

I also used one of Torsten's tests, on git.git, to provide a quick
check on performance:

    $ time bin-wrappers/git -c core.filemode=true status -uno

which gave the following results (5 runs, discard fastest, slowest
and average remaining three):

    master @ 56df44a + this patch
    true   0.641, 0.656, (0.688), 0.657, (0.640) = 0.651
    false  0.500, (0.531), 0.500, (0.469), 0.500 = 0.500

    master @ 56df44a
    true   0.670, (0.734), (0.638), 0.648, 0.663 = 0.660
    false  (0.509), (0.490), 0.496, 0.497, 0.498 = 0.497

So, this patch does not cause any performance regression (+/- 1%).

However, I was a bit worried by the timings, until I noticed that
(on cygwin) the timings are affected by running from the build
directory. Note the timings for v1.8.3:

    v1.8.3 (build)
    true   0.671, 0.672, (0.640), 0.672, (0.969) = 0.672
    false  (0.515), 0.532, 0.516, 0.516, (0.547) = 0.521

    v1.8.3 (installed)
    true   (0.250), (0.266), 0.265, 0.250, 0.265 = 0.260
    false  (0.109), (0.125), 0.109, 0.125, 0.125 = 0.120

Also, just for comparison, here are the numbers for Linux and
MinGW on the same laptop:

                          Linux   MinGW
    master + patch        0.045   0.115
    master @ 56df44a      -----   0.110
    v1.8.3 (build)        0.045   0.109
    v1.8.3 (installed)    0.045   0.094

So, this patch seems to cause a 5% slowdown on MinGW; I haven't
looked into this yet. Note that the "build directory slowdown" is
much less pronounced on MinGW, and non existent (or too small to
notice) on Linux.

This patch is marked RFC because:

    - I don't like the function names; suggestions welcome!
    - Is fast_fstat() necessary; should we remove the use of
      fstat() in write_entry() instead. (I don't think so).
    - Is the 5% slowdown on MinGW a real problem? (are the
      static inline functions being in-lined?)
    - I need to double check that I have replaced all relevant
      lstat() calls.

ATB,
Ramsay Jones


Ramsay Jones (1):
  cygwin: Add fast_lstat() and fast_fstat() functions

 builtin/apply.c        |  8 ++++----
 builtin/commit.c       |  2 +-
 builtin/ls-files.c     |  2 +-
 builtin/rm.c           |  2 +-
 builtin/update-index.c |  2 +-
 check-racy.c           |  2 +-
 compat/cygwin.c        | 48 ++++++++++--------------------------------------
 compat/cygwin.h        | 17 +++++++++--------
 diff-lib.c             |  2 +-
 diff.c                 |  2 +-
 entry.c                |  6 +++---
 git-compat-util.h      | 27 +++++++++++++++++++++++++--
 help.c                 |  5 +----
 path.c                 |  9 +--------
 preload-index.c        |  2 +-
 read-cache.c           |  6 +++---
 unpack-trees.c         |  8 ++++----
 17 files changed, 68 insertions(+), 82 deletions(-)

-- 
1.8.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-10 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10 20:19 [RFC/PATCH v2 0/1] cygwin: fast stat functions Ramsay Jones

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git