zalando-zmon / zmon-controller

ZMON UI and REST API
https://docs.zmon.io/
Other
21 stars 17 forks source link

Text Input Latency #560

Closed elauria closed 6 years ago

elauria commented 6 years ago

Users have reported significant latency when typing in text input fields of the Alert Details Edit view.

elauria commented 6 years ago

Using one-way binding for window title variables

aermakov-zalando commented 6 years ago

Any updates on this? Typing in ZMON is incredibly frustrating because every keypress takes a second to show up in the UI, so you have to resort to copy-pasting from a separate editor.

elauria commented 6 years ago

@aermakov-zalando could you give more details? is it in any page? or in alerts page only?

we haven't determined the cause for AngularJS to become irresponsive when typing, although we know its related to events being triggered by changes on models attached to input fields. The last PR implemented a debounce of 200ms, so less events would be triggered, which should help. The behaviour that has been reported is also not persistent, it comes and goes. Probably related to the amount of entities of the alert being displayed. Any more info on this subject is welcome!

aermakov-zalando commented 6 years ago

For me this happens 100% of the time and it's very easy to reproduce. Just going to a trial run page or a check edit page and typing in any of the fields gives me a reliable 0.5-1s freeze of the UI after every key press. This happens in both Chrome and Safari, so it's not something browser-related.

aermakov-zalando commented 6 years ago

I would also suggest to use location.replace() in the keypress hooks, otherwise the browser history is polluted with hundreds of useless entries whenever the user types something.

elauria commented 6 years ago

@aermakov-zalando thanks for that suggestion, it was very useful. It has been implemented and it will be deployed soon! sadly this does not improve the sluggish behaviour. I'll try to take a look in the coming days.

aermakov-zalando commented 6 years ago

I can help you with reproducing or profiling if needed. Thanks for the help!

elauria commented 6 years ago

@aermakov-zalando we determined the source of this problem to be related to the Entity Filter autocomplete. The autocomplete data has grown to 25MB and this was being attached to the scope. We did changes to detach it from the scope but the amount of data is still being fetched (once). I hope this helps, though probably you won't notice any improvement during the initial load (first seconds when opening trial run, alert edit or check edit for the first time).

aermakov-zalando commented 6 years ago

This is great, thanks a lot! After waiting for a couple of seconds there's no visible latency when editing any of the fields.

elauria commented 6 years ago

@aermakov-zalando great! i'll close this then :)