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

Re: Performance problem, long run of identical hashes

From
David Kastrup <dak@gnu.org>
Date
Dec 10, 2007, 16:14 UTC
Message-ID
<85lk82plwv.fsf@lola.goethe.zz>
In-Reply-To
<alpine.LFD.0.99999.0712101037270.555@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
Show 15 quoted lines
> On Mon, 10 Dec 2007, Jon Smirl wrote:
>
>> Running oprofile during my gcc repack shows this loop as the hottest
>> place in the code by far.
>
> Well, that is kind of expected.
>
>> I added some debug printfs which show that I
>> have a 100,000+ run of identical hash entries. Processing the 100,000
>> entries also causes RAM consumption to explode.
>
> That is impossible.  If you look at the code where those hash entries 
> are created in create_delta_index(), you'll notice a hard limit of 
> HASH_LIMIT (currently 64) is imposed on the number of identical hash 
> entries.

Well, impossible is a strong word to use with respect to code: bugs are possible. However, we have the assertion

	assert(packed_entry - (struct index_entry *)mem == entries);

in create_delta_index and that makes a pretty strong guarantee that the culling of hash entries should be effective. So at least the overall _number_ of entries should be consistent. If there is a bug, it might be that they get garbled or something.

It is also not clear how this could cause an explosion of RAM consumption in the loop.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Nicolas PitreNext: Jon Smirl
Message 3 of 7 in “Performance problem, long run of identical hashes”
  1. Jon SmirlDec 10, 2007
  2. Nicolas PitreDec 10, 2007
  3. David KastrupDec 10, 2007
  4. Jon SmirlDec 10, 2007
  5. Nicolas PitreDec 10, 2007
  6. David KastrupDec 10, 2007
  7. Nicolas PitreDec 10, 2007

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.