Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I end up hanging on GetProxiesAsync a lot. It's which calls GetManagedObjects too often. #6

Open
frankhommers opened this issue Jun 6, 2020 · 1 comment

Comments

@frankhommers
Copy link

I think GetManagedObjects is called too often in your code, see explanation here: https://stackoverflow.com/a/52557430/971229

@frankhommers 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
@gvheertum
Copy link

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.

Source

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants