1
0
mirror of https://github.com/git/git.git synced 2025-04-06 10:47:05 +00:00
Dan McGee 38d4debb6d pack-objects: don't traverse objects unnecessarily
This brings back some of the performance lost in optimizing recency
order inside pack objects. We were doing extreme amounts of object
re-traversal: for the 2.14 million objects in the Linux kernel
repository, we were calling add_to_write_order() over 1.03 billion times
(a 0.2% hit rate, making 99.8% of of these calls extraneous).

Two optimizations take place here- we can start our objects array
iteration from a known point where we left off before we started trying
to find our tags, and we don't need to do the deep dives required by
add_family_to_write_order() if the object has already been marked as
filled.

These two optimizations bring some pretty spectacular results via `perf
stat`:

task-clock:   83373 ms        --> 43800 ms         (50% faster)
cycles:       221,633,461,676 --> 116,307,209,986  (47% fewer)
instructions: 149,299,179,939 --> 122,998,800,184  (18% fewer)

Helped-by: Ramsay Jones (format string fix in "die" message)
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-20 17:17:49 -07:00
..
2011-03-09 23:52:57 -08:00
2011-06-20 14:27:36 -07:00
2011-08-04 15:57:18 -07:00
2011-08-28 21:20:28 -07:00
2010-10-21 17:16:10 -07:00
2011-08-28 21:19:16 -07:00
2011-08-28 21:22:58 -07:00
2011-03-22 10:16:54 -07:00
2011-03-22 11:43:27 -07:00
2011-08-28 21:19:16 -07:00
2011-09-12 11:43:58 -07:00
2010-11-24 15:55:19 -08:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-08-28 21:19:16 -07:00
2011-03-09 23:52:56 -08:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-09-06 11:42:12 -07:00
2011-03-22 11:43:27 -07:00
2011-03-22 10:16:54 -07:00
2011-08-25 16:00:07 -07:00
2011-05-31 12:19:11 -07:00
2011-05-19 10:55:54 -07:00
2011-03-09 23:52:56 -08:00
2011-05-31 12:19:11 -07:00
2011-03-22 10:16:54 -07:00
2011-08-25 14:42:11 -07:00
2010-11-15 10:04:43 -08:00
2011-03-22 10:16:54 -07:00