GNOME Bugzilla – Bug 696209
Could --query-* cli options be made faster?
Last modified: 2013-04-14 11:06:12 UTC
Currently, execution of "banshee --query-title" takes about 200-300ms - same for other queries. Since I use this options to do some scripting, the resulting lag is quite significant. Why is querying banshee's state so slow? Is there a way to make it faster?
I found out that queries can be batched together to reduce the delay: banshee --query-title --query-artist --query-duration But still, I do not understand where the 200 ms overhead comes from.
Thank you for your bug report. When you run "banshee" with some --query* parameter, it starts a new banshee process, which uses DBus to detect that there's already a Banshee process running, and then sends the query through DBus and displays the response. So the delay might just be the startup of the new process (mono does add a slight overhead on startup). I also get about 200ms response times on my system. You might be able to do what you want by using DBus directly. If your scripts are shell scripts, maybe with command-line tools "dbus-send" or "gdbus call ..." As we implement the standard MPRIS interface, it would even work with other players. For example, here's what I get: $ time gdbus call -e -d org.mpris.MediaPlayer2.banshee -o /org/mpris/MediaPlayer2 -m org.mpris.MediaPlayer2.Player.GetMetadata ({'mpris:trackid': <objectpath '/org/bansheeproject/Banshee/Track/4314043'>, 'mpris:length': <int64 133982000>, ...},) real 0m0.015s user 0m0.000s sys 0m0.004s
Thanks a lot! Now the response time is down to 20ms, that's much better. I'm closing the issue, then.