From: Junio C Hamano Date: Fri, 22 Jul 2016 19:30:35 GMT Subject: Re: [PATCH] diff: do not reuse worktree files that need "clean" conversion Message-ID: In-Reply-To: <20160722181024.GA16595@sigill.intra.peff.net> Jeff King writes: > So I think we actually _can_ think of would_convert_to_git() as > basically free. Or as free as other efficient-lookup functions we call > like cache_name_pos(). OK. > The thought "does this tree reuse even speed things up enough to justify > its complexity" definitely crossed my mind. It's basically swapping > open/mmap for zlib inflating the content. > > But I do think it helps in the "want_file" case (i.e., when we are > writing out a tempfile for an external command via prepare_temp_file()). > There it helps us omit writing a tempfile to disk entirely, including > any possible conversion. OK.