On Sun, 2006-04-23 at 12:59 +0200, Dirk Meyer wrote:
> Yes, the reason for that is that foo.srt may affect the metadata for
> foo.avi. But your listdir code now has a key list, maybe we can pass
> that to the results, too? In that case it should be faster to access
> all keys starting with the current basename.

When you're talking about a common code path (like _scan), it's worth it
to maintain as many dicts as are necessary to avoid even O(n) where you
can.  But O(n^2) is just wayyyy too much.  On /usr/bin with 2192 files,
it must make 4804864 iterations to do a scan.

> BTW, at the and of query_dir we do a         
> |items.sort(lambda x,y: cmp(x.url, y.url))
> 
> The code make sure the the items are already sorted based on the name
> (not the url, which is a bit different). But I can't remeber why it
> could be a bad idea to just return a list of items sorted by name in
> this case.

It'd definitely be nice to remove that sort if possible.  On /usr/bin
that saves ~25000 invocations of that lambda :)

Jason.



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to