[PATCH 0 of 5] using ctypes on Windows

Adrian Buehlmann adrian at cadifra.com
Tue Feb 8 12:46:55 CST 2011


On 2011-02-08 19:05, Adrian Buehlmann wrote:
> On 2011-02-08 18:05, Mads Kiilerich wrote:
>> On 02/08/2011 05:52 PM, Adrian Buehlmann wrote:
>>> The first patch ports win32.py to using Python's ctypes library
>>> on Windows (replacing pywin32).
>>
>> Has it been benchmarked?
> 
> I've seen no noticeable slowdown.

I should add that there's only two functions that could be interesting
at all regarding speed: our famous nlinks() and os_link().

These two are called many times per hg invocation (os_link on clone,
nlinks when writing history).

The next file access functions are samefile() and samedevice(), but
these are only used by the relink extension.

The rest of win32.py is totally uninteresting regarding speed, since
these other functions are never used more than at most a couple times
per hg invocation, or rather exactly once (e.g. lookup_reg, spawndetached).

If it turns out that the speed of nlinks() or os_link() should not be
satisfying enough, we could always reach for a osutils.c implementation
fast override. But from what I've seen in my testing, this shouldn't be
necessary.


More information about the Mercurial-devel mailing list