[PATCH RFC] scmutil: 14% speedup in casecollisionauditor

Joshua Redstone joshua.redstone at fb.com
Tue Jul 17 15:49:22 CDT 2012


I like it.  In fact, instead of doing the linear search for an existing
name during a collision, can we just do a lookup in the dirstate._map
directly?
Josh

On 7/16/12 2:22 PM, "Matt Mackall" <mpm at selenic.com> wrote:

>On Mon, 2012-07-16 at 18:14 +0000, Joshua Redstone wrote:
>> Hi Matt,
>> It's very similar to your patch, except it populates a map (with same
>> semantics as the map today) rather than a set.  A set doesn't have
>>enough
>> information to disambiguate adding the same file twice and adding two
>> files that differ only in case.  That was the problem that was causing
>> test failures with your patch.  The downside is that calculating the map
>> takes more time, which is why the speedup is less than we saw with just
>> the set.
>
>Ahh, right.
>
>Here's the strategy I think we should use:
>
>- build a set
>- IFF we encounter a collision, do a linear search for the preexisting
>file
> - if that file has a difference case, we've found a collision
> - if that file has the same case, well we just tried to add the same
>file twice
>
>I think this strikes the right balance: as fast as possible in the
>common case, correct in the error case.
>
>-- 
>Mathematics is the supreme nostalgia of our time.
>
>



More information about the Mercurial-devel mailing list