You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
frankhommers
changed the title
I end up hanging on GetProxiesAsync a lot. It's called too often.
I end up hanging on GetProxiesAsync a lot. It's which calls GetManagedObjects too often.
Jun 10, 2020
I noticed that issue too. The DBUS documentation states that you should not call the GetManagedObjects that often if you don't expect to query the whole tree.
The GetManagedObjects method allows the full object tree to be queried, returning all the objects’ properties too, eliminating the need for further IPC round trips to query the properties.
If clients are not expected to be interested in most of the exposed objects, ObjectManager should not be used, as it will send all of the objects to each client anyway, wasting bus bandwidth. A file manager, therefore, should not expose the entire file system hierarchy using ObjectManager.
By adding some logging and times I saw that when the application is running for quite a while and is using the DBUS commands quite often the requests to the GetProxiesAsync is take longer and longer. Pinpointing it further down learned me that it was indeed the GetManagedObjects that took most of the time.
There is a subscription mechanism for the DBUS where you can subscribe to the addition and removal of objects to the tree. I have made some local changes which I can share via a PR if you like.
The library however still has some limitations on the performance aspect. I noticed that running on a Pi 3b+ the performance is fluctuating and sometimes it takes a couple of seconds to get for example BT discovery going.
I think GetManagedObjects is called too often in your code, see explanation here: https://stackoverflow.com/a/52557430/971229
The text was updated successfully, but these errors were encountered: