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

Re: [PATCH v2] merge-recursive: change current file dir string_lists to hashmap

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2017, 23:44 UTC
Message-ID
<xmqqmv672xzb.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170906222834.77116-1-kewillf@microsoft.com>
Kevin Willford <kewillf@microsoft.com> writes:
Show 26 quoted lines
> The code was using two string_lists, one for the directories and
> one for the files.  The code never checks the lists independently
> so we should be able to only use one list.  The string_list also
> is a O(log n) for lookup and insertion.  Switching this to use a
> hashmap will give O(1) which will save some time when there are
> millions of paths that will be checked.
>
> Also cleaned up a memory leak and method where the return was not
> being used.
>
> Signed-off-by: Kevin Willford <kewillf@microsoft.com>
> ---
>  merge-recursive.c | 76 ++++++++++++++++++++++++++++++++++++++++---------------
>  merge-recursive.h |  3 +--
>  2 files changed, 57 insertions(+), 22 deletions(-)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 1494ffdb82..ebfe01017f 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -24,6 +24,31 @@
>  #include "dir.h"
>  #include "submodule.h"
>  
> +struct path_hashmap_entry {
> +	struct hashmap_entry;

You seem to have lost the squash you privately agreed to that is needed in order to make it compile?

Previous: Kevin Willford
Message 2 of 2 in “merge-recursive: change current file dir string_lists to hashmap”
  1. merge-recursive: change current file dir string_lists to hashmapKevin Willford, Sep 6, 2017
  2. Junio C HamanoSep 6, 2017

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.