{"thread":{"id":"34399","subject":"[RFC/PATCH v2 0/1] cygwin: fast stat functions","startedAt":"2013-07-10T20:19:42Z","lastAt":"2013-07-10T20:19:42Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":2,"patchTotal":1},"messages":[{"id":"223037","messageId":"51DDC1DE.1060709@ramsay1.demon.co.uk","threadId":"34399","inReplyTo":null,"subject":"[RFC/PATCH v2 0/1] cygwin: fast stat functions","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-07-10T20:19:42Z","receivedAt":"2013-07-10T20:19:42Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIf you are wondering, v1 of this patch was appended to an email\nthat is part of the \"cygwin: Remove the Win32 l/stat() functions\"\nthread.\n\nChanges from v1:\n\n    - add comment in git-compat-util.h to explain the use\n      of the \"fast\" stat variants.\n    - remove the fast_stat() function, along with the now\n      redundant code in compat/cygwin.c\n    - add the fast_fstat() function; this is used by code\n      in write_entry() (entry.c:139), even though it is not\n      actually called by cygwin.\n    - replaced an additional call to lstat with fast_lstat.\n    - a commit message\n\nThis patch, which was built on master @ commit 56df44a, has passed\nthe full test suite:\n\n    $ GIT_SKIP_TESTS='t0008 t0061.3 t0070.3 t4130 t9010 t9300' \\\n        make test >test-outp15 2>&1\n    $\n\nAfter Torsten's patch, I didn't need to skip t0070.3; that was just\nforce of habit! Once Mark's PIPE prerequisite patch is applied, I\nwould not have to skip t0008, t9010 and t9300.\n\nI also used one of Torsten's tests, on git.git, to provide a quick\ncheck on performance:\n\n    $ time bin-wrappers/git -c core.filemode=true status -uno\n\nwhich gave the following results (5 runs, discard fastest, slowest\nand average remaining three):\n\n    master @ 56df44a + this patch\n    true   0.641, 0.656, (0.688), 0.657, (0.640) = 0.651\n    false  0.500, (0.531), 0.500, (0.469), 0.500 = 0.500\n\n    master @ 56df44a\n    true   0.670, (0.734), (0.638), 0.648, 0.663 = 0.660\n    false  (0.509), (0.490), 0.496, 0.497, 0.498 = 0.497\n\nSo, this patch does not cause any performance regression (+/- 1%).\n\nHowever, I was a bit worried by the timings, until I noticed that\n(on cygwin) the timings are affected by running from the build\ndirectory. Note the timings for v1.8.3:\n\n    v1.8.3 (build)\n    true   0.671, 0.672, (0.640), 0.672, (0.969) = 0.672\n    false  (0.515), 0.532, 0.516, 0.516, (0.547) = 0.521\n\n    v1.8.3 (installed)\n    true   (0.250), (0.266), 0.265, 0.250, 0.265 = 0.260\n    false  (0.109), (0.125), 0.109, 0.125, 0.125 = 0.120\n\nAlso, just for comparison, here are the numbers for Linux and\nMinGW on the same laptop:\n\n                          Linux   MinGW\n    master + patch        0.045   0.115\n    master @ 56df44a      -----   0.110\n    v1.8.3 (build)        0.045   0.109\n    v1.8.3 (installed)    0.045   0.094\n\nSo, this patch seems to cause a 5% slowdown on MinGW; I haven't\nlooked into this yet. Note that the \"build directory slowdown\" is\nmuch less pronounced on MinGW, and non existent (or too small to\nnotice) on Linux.\n\nThis patch is marked RFC because:\n\n    - I don't like the function names; suggestions welcome!\n    - Is fast_fstat() necessary; should we remove the use of\n      fstat() in write_entry() instead. (I don't think so).\n    - Is the 5% slowdown on MinGW a real problem? (are the\n      static inline functions being in-lined?)\n    - I need to double check that I have replaced all relevant\n      lstat() calls.\n\nATB,\nRamsay Jones\n\n\nRamsay Jones (1):\n  cygwin: Add fast_lstat() and fast_fstat() functions\n\n builtin/apply.c        |  8 ++++----\n builtin/commit.c       |  2 +-\n builtin/ls-files.c     |  2 +-\n builtin/rm.c           |  2 +-\n builtin/update-index.c |  2 +-\n check-racy.c           |  2 +-\n compat/cygwin.c        | 48 ++++++++++--------------------------------------\n compat/cygwin.h        | 17 +++++++++--------\n diff-lib.c             |  2 +-\n diff.c                 |  2 +-\n entry.c                |  6 +++---\n git-compat-util.h      | 27 +++++++++++++++++++++++++--\n help.c                 |  5 +----\n path.c                 |  9 +--------\n preload-index.c        |  2 +-\n read-cache.c           |  6 +++---\n unpack-trees.c         |  8 ++++----\n 17 files changed, 68 insertions(+), 82 deletions(-)\n\n-- \n1.8.3\n"}]}