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

Master UI is unusably slow #5308

Closed
tomwilkie opened this Issue Mar 5, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@tomwilkie
Copy link
Member

tomwilkie commented Mar 5, 2019

Running a very recent build (from yesterday), editing text in the query/graph UI is unusably slow.

Try putting this query in:

  sum by (pod_name, namespace) (container_memory_rss) 
/ 
  sum by (pod_name, namespace) (
    label_replace(
      kube_pod_container_resource_requests_memory_bytes, 
      "pod_name", "$1", "pod", "(.*)"
    )
  ) 

And adding some text after "(.*)".

Heres a profile:

screenshot 2019-03-05 at 14 10 01

Took ~2s to handle the keypress. I don't know whats going on though. @davkal ?

@davkal

This comment has been minimized.

Copy link
Contributor

davkal commented Mar 5, 2019

Taking a look...
Edit: Looks like the input keyhandler is unthrottled. Fix coming up.

davkal added a commit to davkal/prometheus that referenced this issue Mar 5, 2019

Add debounce to input key handling
- every key input called a resize handler for the input text area
- repeated key entry, e.g., quickly moving cursor right, called the
handler on each key press, which triggered a layout reflow
- layout reflows kept piling up making the key input laggy
- this change adds a debounce method, and wraps the key handler in it
- the debounce wait is set to 500ms

Fixes prometheus#5308

davkal added a commit to davkal/prometheus that referenced this issue Mar 5, 2019

Add debounce to input key handling
- every key input called a resize handler for the input text area
- repeated key entry, e.g., quickly moving cursor right, called the
handler on each key press, which triggered a layout reflow
- layout reflows kept piling up making the key input laggy
- this change adds a debounce method, and wraps the key handler in it
- the debounce wait is set to 500ms

Fixes prometheus#5308

Signed-off-by: David Kaltschmidt <david.kaltschmidt@gmail.com>

davkal added a commit to davkal/prometheus that referenced this issue Mar 5, 2019

Set input field height only once per key event
- the input field resize handler set its height twice on each call.
- first to `auto` and then to a numerical value, this causes a layout
reflow each time a key is pressed
- this change removes the set to `auto` which used to be immediatly
overwritten anyway

Fixes prometheus#5308

Signed-off-by: David Kaltschmidt <david.kaltschmidt@gmail.com>

davkal added a commit to davkal/prometheus that referenced this issue Mar 6, 2019

Debounce input key press handling
- input key handler causes 2 layout cycles on each keypress which can
clog up browser rendering when typing quickly
- this change adds a debounce to the key press handler of 500ms

Fixes prometheus#5308
Signed-off-by: David Kaltschmidt <david.kaltschmidt@gmail.com>

@juliusv juliusv closed this in #5309 Mar 6, 2019

juliusv added a commit that referenced this issue Mar 6, 2019

Debounce input key press handling (#5309)
- input key handler causes 2 layout cycles on each keypress which can
clog up browser rendering when typing quickly
- this change adds a debounce to the key press handler of 500ms

Fixes #5308
Signed-off-by: David Kaltschmidt <david.kaltschmidt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.