On Tue, 5 Jan 2010, Jeffrey Middleton wrote:

I'm not too sure about the globbing question at first glance.  However, 
refining ambiguous completion seems a prime candidate for
placing inside mpc. If you filter afterwards with a script, you're wasting time 
querying for information you then waste time
throwing away, while mpc could easily just only list the necessary directories 
then exit.

mpc already wastes the time and bandwidth querying the entire song list
and filtering it.  If we push this code into mpc, we would add many,
many lines of C string manipulation code which needs to be carefully
memory managed.

When done in the completer code, it requires two extra fork()/exec()s of the sed and sort code. The sed and sort code are more general than we would write, but they are also already debugged, and not that much more overhead for something that runs no more than once or twice in a second, and then only occasionally.

This is not an inner loop, and even pushing the code into mpc still
wastes the same amount of bandwidth--which is the only thing we might
want to optimize on.

mpc could do smarter querying of the server, and that would be the right way to optimize this. I'm not having performance problems, but I'm
running mpd locally and on a machine that is only a few years old.

Jeff
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to