git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	git@vger.kernel.org, j6t@kdbg.org, kusmabite@gmail.com,
	mlevedahl@gmail.com, ramsay@ramsay1.demon.co.uk,
	sunshine@sunshineco.com
Subject: Re: [PATCH 2/2] optimize set_shared_perm()
Date: Sat, 30 Mar 2013 10:53:16 +0100	[thread overview]
Message-ID: <5156B60C.6070707@web.de> (raw)
In-Reply-To: <7vli95nbs4.fsf@alter.siamese.dyndns.org>

On 29.03.13 22:20, Junio C Hamano wrote:
[snip]
> The last two points can become a separate "preparation" step.  The
> result would be easier to read.
> 
> Your updated adjust_shared_perm() does not begin with:
> 
> 	if (!shared_repository)
>         	return 0;
> 
> as the original, but it always first calls to get_st_mode_bits()
> which makes a call to lstat(2).
> 
> That smells like a huge regression for !shared_repository case,
> unless you have updated the existing callers of adjust_shared_perm()
> not to call it when !shared_repository.
> 
Thanks for carefull review:
The achieved effect of the code is the same,
but the developer is to blame.

I send a new patch of 2/2 in a minute, splitted into 2 commits.

Highlights of part 2:
a) move "if (!shared_repository)" to the right place
b) Simplify calc_shared_perm() even more: Remove the variable "int shared"
c) Remove calc_shared_perm_dir(), the functionality is baked into
   adjust_shared_perm()

      reply	other threads:[~2013-03-30  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 15:57 [PATCH 2/2] optimize set_shared_perm() Torsten Bögershausen
2013-03-29 21:20 ` Junio C Hamano
2013-03-30  9:53   ` Torsten Bögershausen [this message]

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=5156B60C.6070707@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=kusmabite@gmail.com \
    --cc=mlevedahl@gmail.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    --cc=sunshine@sunshineco.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;
as well as URLs for NNTP newsgroup(s).