On Thu, Jun 12, 2008 at 01:15:03AM +0100, Martin Dengler wrote: > [1-line patch to sugar/graphics/icon.py]
A more performant approach to get_icon_name(), which I think is called a fair bit, would be to cache the list of available files to avoid exercising the file systme a billion times as the wireles signal changes (ooh, imagine the stat()s when showing the mesh view and there are loads of APs around changing signal strength all the time). A related idea is to change this function to really do what it seems to be meaning to do which is quantize the input range 0-100 into the output range (defined by the number of different icon files). However consider that this would affect icon file names if the current user experience is to be preserved. As the number of files deceases the ratio of files to step size grows and starts to dominate the time cost of calculating the output range. And of course my previous suggestion could reduce this cost to constant time. Martin
pgpjll6FKLtdT.pgp
Description: PGP signature
_______________________________________________ Sugar mailing list [email protected] http://lists.laptop.org/listinfo/sugar

