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

Re: speed of git reset -- file

From
Joey Hess <joey@kitenet.net>
Date
Jun 1, 2011, 23:31 UTC
Message-ID
<20110601233157.GA2468@gnu.kitenet.net>
In-Reply-To
<20110601225647.GD16820@sigill.intra.peff.net>
Jeff King wrote:
Show 6 quoted lines
> OK, that's horrific. For me, the stat information for linux-2.6 all sits
> in cache and it takes about 0.3 seconds to refresh the index. I have 8G
> of ram and a nice SSD, though it doesn't actually hit the disk at all.
> 
> Is it really faulting the stat information from disk that takes so long?
> Have you tried running "perf" on "git update-index --refresh"?
Cold cache:
 Performance counter stats for 'git update-index --refresh':
       9725.574501 task-clock-msecs         #      0.337 CPUs 
            58,163 context-switches         #      0.006 M/sec
                94 CPU-migrations           #      0.000 M/sec
             8,637 page-faults              #      0.001 M/sec
    12,825,956,531 cycles                   #   1318.787 M/sec  (scaled from 33.43%)
     2,696,089,912 instructions             #      0.210 IPC    (scaled from 50.03%)
       457,705,110 branches                 #     47.062 M/sec  (scaled from 51.30%)
        40,033,685 branch-misses            #      8.747 %      (scaled from 50.19%)
       149,071,234 cache-references         #     15.328 M/sec  (scaled from 32.83%)
         9,662,661 cache-misses             #      0.994 M/sec  (scaled from 32.27%)
       28.846625099  seconds time elapsed

Warm cache is 0.88 seconds, but cold cache is typical; I use a cheap netbook for a lot of different stuff.

Also, I can get much worse cold cache numbers on eg, a fairly average VPS node, where it takes > 1 minute.

-- 
see shy jo
Previous: Jeff KingNext: Jeff King
Message 13 of 17 in “speed of git reset -- file”
  1. Joey HessMay 31, 2011
  2. Jeff KingMay 31, 2011
  3. Junio C HamanoMay 31, 2011
  4. Jeff KingMay 31, 2011
  5. Matthieu MoyMay 31, 2011
  6. Nguyen Thai Ngoc DuyJun 1, 2011
  7. Junio C HamanoMay 31, 2011
  8. Jeff KingJun 1, 2011
  9. Joey HessJun 1, 2011
  10. Jeff KingJun 1, 2011
  11. Joey HessJun 1, 2011
  12. Jeff KingJun 1, 2011
  13. Joey HessJun 1, 2011
  14. Jeff KingJun 2, 2011
  15. Joey HessJun 2, 2011
  16. Joey HessJun 2, 2011
  17. Junio C HamanoJun 1, 2011

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.