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

Re: [RFC PATCH 3/4] name-rev: check if a commit should be named before naming it

From
Alban Gruin <alban.gruin@gmail.com>
Date
Mar 1, 2019, 18:22 UTC
Message-ID
<992c5d7e-524a-3c92-9f0f-bbefbe151de5@gmail.com>
In-Reply-To
<CAPig+cQmZOWUZuj2+z+qrrCO-YBMNiEnGic1_FwAcaaj5gA5-w@mail.gmail.com>
Hi Eric,
Le 01/03/2019 à 19:05, Eric Sunshine a écrit :
Show 9 quoted lines
> On Fri, Mar 1, 2019 at 12:50 PM Alban Gruin <alban.gruin@gmail.com> wrote:
> -%<-
> Minor: It would probably be more efficient to check if the count is 0
> first, and only search the list if not.
> 
> By the way, how big is 'commits' likely to get? Will the linear scan
> done by commit_list_contains() become an issue? Should it be using a
> hash table instead?
> 

It depends on the amount of commits mentionned in stdin that are reachable from the ref in name_ref(). If there is a lot of commit in the input, it may effectively become a problem.

I thought of adding a field to the rev_name structure for this purpose.
 I think commit slabs are hash maps under the hood?
Show 5 quoted lines
>> +                       name->tip_name = tip_name;
>> +                       free_alloc = 0;
>> +               } else {
>> +                       name->tip_name = NULL;
>> +               }

Cheers, Alban

Previous: Eric SunshineNext: Jeff King
Message 8 of 18 in “name-rev: improve memory usage”
  1. 0/4 name-rev: improve memory usageAlban Gruin, Mar 1, 2019
  2. 1/4 name-rev: improve name_rev() memory usageAlban Gruin, Mar 1, 2019
  3. Eric SunshineMar 1, 2019
  4. Jeff KingMar 1, 2019
  5. Johannes SchindelinMar 2, 2019
  6. 3/4 name-rev: check if a commit should be named before naming itAlban Gruin, Mar 1, 2019
  7. Eric SunshineMar 1, 2019
  8. Alban GruinMar 1, 2019
  9. Jeff KingMar 1, 2019
  10. 2/4 commit-list: add a function to check if a commit is in a listAlban Gruin, Mar 1, 2019
  11. 4/4 name-rev: avoid naming from a ref if it’s not a descendant of any commitAlban Gruin, Mar 1, 2019
  12. Eric SunshineMar 1, 2019
  13. Christian CouderMar 3, 2019
  14. Christian CouderMar 3, 2019
  15. Alban GruinMar 3, 2019
  16. Jeff KingMar 1, 2019
  17. Alban GruinMar 1, 2019
  18. Jeff KingMar 1, 2019

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.