git/builtin
Eric Wong 98521d6f04 cat-file: use delta_base_cache entries directly
For objects already in the delta_base_cache, we can safely use
one entry at-a-time directly to avoid the malloc+memcpy+free
overhead.  For a 1MB delta base object, this eliminates the
speed penalty of duplicating large objects into memory and
speeds up those 1MB delta base cached content retrievals by
roughly 30%.

While only 2-7% of objects are delta bases in repos I've looked
at, this avoids up to 96MB of duplicated memory in the worst
case with the default git config.

The new delta_base_cache_lock is a simple single-threaded
assertion to ensure cat-file (and similar) is the exclusive user
of the delta_base_cache.  In other words, we cannot have diff
or similar commands using two or more entries directly from the
delta base cache.  The new lock has nothing to do with parallel
access via multiple threads at the moment.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-25 10:54:22 -07:00
..
2024-07-08 14:53:10 -07:00
2020-07-30 19:18:06 -07:00
2024-05-21 09:07:48 -07:00
2024-07-08 14:53:10 -07:00
2024-07-08 14:53:10 -07:00
2024-04-18 12:30:42 -07:00
2024-04-18 12:30:42 -07:00
2024-04-18 12:30:42 -07:00
2024-07-08 14:53:10 -07:00
2024-02-13 10:18:50 -08:00
2024-07-08 14:53:10 -07:00
2024-06-06 12:49:23 -07:00
2024-04-18 12:30:42 -07:00
2024-07-08 14:53:10 -07:00
2024-06-20 15:45:12 -07:00
2023-07-06 11:54:48 -07:00
2024-07-08 14:53:10 -07:00
2024-07-02 09:59:01 -07:00
2024-04-18 12:30:42 -07:00
2024-06-11 13:15:08 -07:00
2024-07-08 14:53:10 -07:00
2024-05-30 08:55:29 -07:00
2024-07-02 09:59:00 -07:00
2024-06-14 09:34:39 -07:00
2024-04-18 12:30:42 -07:00
2024-05-17 10:33:39 -07:00
2024-07-02 09:59:01 -07:00
2024-06-06 12:49:23 -07:00
2024-06-11 13:15:06 -07:00
2024-04-29 20:42:30 +02:00
2024-05-17 10:33:39 -07:00
2024-06-06 12:49:23 -07:00
2024-04-18 12:30:42 -07:00