git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ben Peart" <peartben@gmail.com>
Cc: <git@vger.kernel.org>, <pclouds@gmail.com>,
	"'Ben Peart'" <benpeart@microsoft.com>
Subject: Re: [PATCH v2] checkout: eliminate unnecessary merge for trivial checkout
Date: Mon, 12 Sep 2016 13:31:30 -0700	[thread overview]
Message-ID: <xmqqtwdkzwpp.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <13ef001d20d21$2d2ea840$878bf8c0$@gmail.com> (Ben Peart's message of "Mon, 12 Sep 2016 14:12:07 -0400")

"Ben Peart" <peartben@gmail.com> writes:

> I completely agree that optimizing within merge_working_tree would provide 
> more opportunities for optimization.  I can certainly move the test into
> that function as a first step.

Note that "optimizing more" was not the primary point of my
response.

Quite honestly, I'd rather see us speed up _ONLY_ obviously correct
and commonly used cases, while leaving most cases that _MAY_ turn
out to be optimizable (if we did careful analysis) unoptimized, and
instead have them handled by generic but known to be correct
codepath, if it means we do NOT to have to spend mental bandwidth to
analyze not-common case--that is a much better tradeoff.

The suggestion to move the check one level down in the callchain was
primarily to avoid the proposed optimization from being overly eager
and ending up skipping necessary parts of what merge_working_tree()
does (e.g. like I suspected in the review that the proposed patch
skips the check for "you have unmerged entries" situation).

  reply	other threads:[~2016-09-12 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09 19:25 [PATCH v2] checkout: eliminate unnecessary merge for trivial checkout Ben Peart
2016-09-09 21:55 ` Junio C Hamano
2016-09-12 18:12   ` Ben Peart
2016-09-12 20:31     ` Junio C Hamano [this message]
2016-09-13 12:33       ` Ben Peart

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqtwdkzwpp.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=benpeart@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peartben@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).