[python-win32] Overlay Icon Question and network drives

Tim Golden mail at timgolden.me.uk
Wed Apr 16 15:39:04 CEST 2008


python at kareta.de wrote:
> Hi Andrea,
> 
> the code in my first link was from the mercurial extension TortoiseHG. They
> found some issues that the icon overlay slows down network devices. See here:
> 
> https://sourceforge.net/tracker/index.php?func=detail&aid=1892791&group_id=199155&atid=968354
> 
> Could you please tell if you have the same issues with the code Roger posted ?

Worth noting that *any* code which is messing with icon overlays should
be just about as tight as it can possibly be. TortoiseSVN, which is written in 
C++ has been doing this for years, tweaks its overlay & cache code on 
pretty much every minor release to squeeze some more performance.

I had a quick glance at the TortoiseHg code and was a bit surprised that
the key _get_state function isn't as tight as it might be. I say that, however,
with a huge amount of diffidence as I've had nothing whatsoever to do with
it and I imagine the developer's tried all sorts of tricks to speed things up.

If the problem only seriously affects network drives, it's likely that the code's
doing too many calls to query file existence and attributes, all of which will
suffer on a (slower) network connection.

Be interesting knowing whether other overlay handlers such as TortoiseSVN/CVS
cause the same problem, whether a simple no-op or one-op implementation
of _get_state ameliorates things, or whether the added layer of the Python
interpreter is causing the problems.

As a side note, might be worth tying in to the TortoiseOverlays projects
which provides for a shared set of overlays for all Tortoise.. projects,
preventing problems with the rather low system limit. (Don't imagine it
would help speed things up, tho', since it introduces *another* layer
into the stack).

Perusing the code at:

http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/TortoiseShell/IconOverlay.cpp

was very instructive! Worth checking the repos out to look at the log, too.

TJG


More information about the python-win32 mailing list