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

Improve Things overview performance #439

Closed
wborn opened this issue Oct 24, 2020 · 7 comments
Closed

Improve Things overview performance #439

wborn opened this issue Oct 24, 2020 · 7 comments
Labels
main ui Main UI question Further information is requested

Comments

@wborn
Copy link
Member

wborn commented Oct 24, 2020

When my browser shows the Things overview (e.g. http://localhost:8080/#!/settings/things/) the performance isn't that great. As a result the browser is sluggish and scrolling isn't instantaneous.

It's probably because I have 100+ Things in this overview and it is processing 10+ SSE events per second because of this. I compared it with the Paper UI Things overview and it seems to handle the same amount of SSE events in its overview without any noticable performance issues.

Most of the messages are ThingStatus updates. It looks like there is no filtering done in the backend. So it pushes events to the frontend regardless of if there was any (status) change.

@ghys ghys added main ui Main UI question Further information is requested labels Oct 25, 2020
@ghys
Copy link
Member

ghys commented Oct 25, 2020

I'm not sure the problem is really with the SSE status updates (although 10+ a second is a lot!) but simply that the CSS of those lists is on the heavy side and perhaps suboptimal. Some channels lists with 200+ channels (Nibe pump simulator things) are affected too.

In my experience ~150-200 is the max number of items those lists can handle before you start to notice the performance degrading, depending on your device. After that using a so-called "virtual list" is recommended, but then you can say goodbye to that nice grouping by initial or binding (or channel group in the channels list case) because the items' height has to be fixed and predictable.

I used a virtual list for the items and in some other places, it was a non-brainer because most users will have hundreds if not thousands of items; but for things, rules and pages I was somewhat hoping that the vast majority would stay below that threshold.

Maybe we could transform to a virtual list but only after we reach such a threshold (you'll lose the grouping and the index on the right, but only in that case).

@wborn
Copy link
Member Author

wborn commented Oct 25, 2020

I just retested this by uninstalling all bindings so the frontend does not have to handle any SSE. When it doesn't handle any SSE there are no performance issues when scrolling through the list. I haven't looked at the code, but maybe the performance can be improved by only updating Things when there are actual changes.

@ghys
Copy link
Member

ghys commented Oct 25, 2020

Oh, okay, then it might be worth a shot 👍
Do you know why you have so many thing status updates, it really seems to be a lot? Maybe there's something to fix in the binding causing this?

@wborn
Copy link
Member Author

wborn commented Oct 25, 2020

I have many lights that are continuously polled for their state. That results in the ThingStatus updates. There's already some logic to reduce the number of updates to at most 1 per second per light, see eclipse-archived/smarthome#3816. It can probably be throttled even more, but it wasn't necessary previously because Paper UI had no issues with this amount of updates.

It would be nice if the backend was a little bit smarter and would only send SSE to subscribers for changes. That would be a more generic solution which would solve the issue for all add-ons and SSE subscribers.

ghys added a commit to ghys/openhab-webui that referenced this issue Oct 29, 2020
Only update thing statusInfo fields which change when
receiving a status update through SSE in the thing list.
Could help with openhab#439.

Show tooltip with the status description when howevering
over the status badge.
Closes openhab#414.

Signed-off-by: Yannick Schaus <github@schaus.net>
@ghys ghys mentioned this issue Oct 29, 2020
@ghys
Copy link
Member

ghys commented Oct 29, 2020

@wborn could you do a bundle:update org.openhab.ui https://ci.openhab.org/view/Pull%20Request%20Builds/job/PR-openHAB-WebUI/lastSuccessfulBuild/artifact/bundles/org.openhab.ui/target/org.openhab.ui-3.0.0-SNAPSHOT.jar and tell if it helps with your performance problems?

@wborn
Copy link
Member Author

wborn commented Oct 29, 2020

Yes it helps a lot with the performance! It makes the scrolling fluid again.
I don't notice any lagging at all with these changes. Thanks for looking into this @ghys. 👍

@ghys
Copy link
Member

ghys commented Oct 29, 2020

Great, let's merge it then.

ghys added a commit that referenced this issue Oct 29, 2020
Only update thing statusInfo fields which change when
receiving a status update through SSE in the thing list.
Could help with #439.

Show tooltip with the status description when howering
over the status badge.
Closes #414.

Signed-off-by: Yannick Schaus <github@schaus.net>
@ghys ghys closed this as completed Oct 31, 2020
ghys added a commit to ghys/openhab-webui that referenced this issue Dec 20, 2020
Depends on openhab/openhab-core#1970.

Also:
- Add abiilty to create a Blockly script directly.

- Only update statuses that changed in the rules list (might help with openhab#673 and similar to openhab#466/openhab#439).

Signed-off-by: Yannick Schaus <github@schaus.net>
ghys added a commit that referenced this issue Dec 20, 2020
Depends on openhab/openhab-core#1970.

Also:
- Add abiilty to create a Blockly script directly.

- Only update statuses that changed in the rules list (might help with #673 and similar to #466/#439).

Signed-off-by: Yannick Schaus <github@schaus.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
main ui Main UI question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants