public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Meet Soni <meetsoni3017@gmail.com>,  git@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] merge-recursive: optimize time complexity for get_unmerged
Date: Thu, 13 Feb 2025 10:30:50 -0800	[thread overview]
Message-ID: <xmqqwmdtofxh.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BGqihkPq3o4jnqp2aGdqw12F8a8nOModuAB-5N7BQ1t0w@mail.gmail.com> (Elijah Newren's message of "Thu, 13 Feb 2025 09:11:33 -0800")

Elijah Newren <newren@gmail.com> writes:

> (As a side note, due to the specialized structure of the input, I
> suspect this code could be modified to run in O(n), i.e. we could skip
> the string_list_lookup and the string_list_sort and the
> string_list_remove_duplicates...

Are you talking about the input being already sorted so we can just
walk the multiple input and merge them into a single stream?  In the
cost analysis you did earlier in the message I am responding to,
being able to go down to O(n) sounds really like a great thing ;-)

> But, it'd make the code trickier, so
> it'd need to be carefully commented, the change would need to be
> justified, and it'd need to be carefully tested.  

... and measured.

> Even if we weren't
> planning to delete this entire file, I suspect it's not possible to
> find a case justifying such a change without optimizing several other
> things in merge-recursive first, but optimizing those things probably
> results in a significant rewrite...which we've already done with
> merge-ort.)

Sounds like unless the performance issues are shared between the
two, it may not be worth to spend too much brain cycles only on the
"recursive" one?

Thanks.

  reply	other threads:[~2025-02-13 18:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 19:43 [GSoC][PATCH] merge-recursive: optimize string_list construction Meet Soni
2025-02-11 20:59 ` Elijah Newren
2025-02-13  9:00 ` [RFC PATCH 0/2] merge-recursive: optimize time complexity Meet Soni
2025-02-13  9:00   ` [RFC PATCH 1/2] merge-recursive: optimize time complexity for process_renames Meet Soni
2025-02-13 17:06     ` Elijah Newren
2025-02-13  9:00   ` [RFC PATCH 2/2] merge-recursive: optimize time complexity for get_unmerged Meet Soni
2025-02-13 17:11     ` Elijah Newren
2025-02-13 18:30       ` Junio C Hamano [this message]
2025-02-13 18:45         ` Elijah Newren
2025-02-14  4:28       ` Meet Soni
2025-02-14  6:04         ` Elijah Newren
2025-02-14  8:24           ` Meet Soni
2025-02-14 19:00             ` Elijah Newren
2025-02-15  8:42               ` Meet Soni
2025-02-13 11:02   ` [RFC PATCH 0/2] merge-recursive: optimize time complexity Meet Soni
2025-02-13 18:30   ` Elijah Newren
2025-02-14  4:41   ` [GSoC][PATCH v2] merge-recursive: optimize time complexity for process_renames Meet Soni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwmdtofxh.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=meetsoni3017@gmail.com \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox