After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696209 - Could --query-* cli options be made faster?
Could --query-* cli options be made faster?
Status: RESOLVED NOTABUG
Product: banshee
Classification: Other
Component: User Interface
2.4.1
Other Linux
: Normal enhancement
: ---
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-20 16:05 UTC by platon7pronko
Modified: 2013-04-14 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description platon7pronko 2013-03-20 16:05:41 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?
Comment 1 platon7pronko 2013-04-03 15:13:19 UTC
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.
Comment 2 Bertrand Lorentz 2013-04-14 10:35:40 UTC
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
Comment 3 platon7pronko 2013-04-14 11:04:04 UTC
Thanks a lot! Now the response time is down to 20ms, that's much better. I'm closing the issue, then.