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

Huge lag renaming workpad #25070

Closed
alexfrancoeur opened this issue Nov 2, 2018 · 3 comments
Closed

Huge lag renaming workpad #25070

alexfrancoeur opened this issue Nov 2, 2018 · 3 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Canvas impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:medium Medium Level of Effort performance Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@alexfrancoeur
Copy link

There is a strange lag when renaming the workpad and I now have a feeling it has to do with updating the title of the tab. See the gif below

nov-02-2018 14-47-27

cc: @cqliu1

@alexfrancoeur alexfrancoeur added bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Nov 2, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@rayafratkina
Copy link
Contributor

Current theory is that as the size of the workpad increases, all actions that do not have apply button are slow (not just renaming workpad). It is easiest to see this effect by adding lots of images.
First order root cause is that today at every save all state is re-persisted on the server. This used to work differently (only changes were persisted) but seems to have broken at some point. We are not sure when this got changed.

There is probably a short term low hanging fruit improvement we can make here and a longer term architectural change needed. We will try to get the lonw hanging fruit fix done asap (possibly 6.6)

Some other notes form the conversation:
From Joe Fleming @ Elastic to Everyone: 12:03 PM
this is almost certainly entirely a redux issue. i don’t think the network part of this affects things at all, those are just fire and forget (which is another bug)
From Rashid Khan to Everyone: 12:04 PM
there is almost certainly a “quick” win
i agree, i don’t think the network part is a big deal
From Clint to Everyone: 12:04 PM
++
From Rashid Khan to Everyone: 12:04 PM
totally just a redux thing. We already debounce the persist to ES iirc
From Robert Monfera to Everyone: 12:04 PM
on Cloud, seeing Tim's screen, he was throttled heavily by network, one reason for a number of PRs back then

@w33ble
Copy link
Contributor

w33ble commented Feb 22, 2019

When I set up why-did-you-update, there's a stream of needless re-renders that happen every time you change a character in the workpad's name.

feb-22-2019 16-48-10

That stream of output is triggered by deleting a character, and you can see a huge delay before Chrome is able to render the change in the browser. Every line is a needless re-render, and the WorkpadPage just thrashes with every character change.

screenshot 2019-02-22 16 51 51

#31734 makes this a little better (it prevents all the elements in the page from also re-rendering), but there's still a big performance win to be had here by stopping re-renders.

@w33ble w33ble self-assigned this Feb 25, 2019
w33ble added a commit that referenced this issue Mar 2, 2019
)

In an effort to remove the workpad renaming lag in #25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit to w33ble/kibana that referenced this issue Mar 2, 2019
…stic#31958)

In an effort to remove the workpad renaming lag in elastic#25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit to w33ble/kibana that referenced this issue Mar 2, 2019
…stic#31958)

In an effort to remove the workpad renaming lag in elastic#25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit to w33ble/kibana that referenced this issue Mar 2, 2019
…stic#31958)

In an effort to remove the workpad renaming lag in elastic#25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit that referenced this issue Mar 5, 2019
) (#32359)

In an effort to remove the workpad renaming lag in #25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit that referenced this issue Mar 5, 2019
) (#32358)

In an effort to remove the workpad renaming lag in #25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
w33ble added a commit that referenced this issue Mar 5, 2019
) (#32357)

In an effort to remove the workpad renaming lag in #25070, I started hunting down and fixing re-renders that happened with the name change. 

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering
monfera pushed a commit to monfera/kibana that referenced this issue Mar 8, 2019
…stic#31958)

In an effort to remove the workpad renaming lag in elastic#25070, I started hunting down and fixing re-renders that happened with the name change.

I was hoping this PR would fix the lag, but I've shifted to some other performance issues that have a much larger impact, so this is just a bunch of re-rendering fixes, which come with some performance gains. Here's the breakdown:

- `Workpad`, `WorkpadHeader`, and `FullscreenControl` would always re-render because the hotkey handler function was always re-created
- `Workpad` would re-render when the workpad's name changed
  - We were passing the whole workpad object into the component, so it re-rendered on all sorts of changes
  - Page title updating moved to middleware so the component doesn't need that value
- `AssetManager` would always re-render if the parent re-rendered because it always created a new state value in `mapStateToProps`
- make `Workpad` and `Toolbar` pure, they take no props and this helps stop some re-rendering

(cherry picked from commit 7d8dbc6)
@cqliu1 cqliu1 added the loe:medium Medium Level of Effort label Mar 19, 2019
@w33ble w33ble removed the v6.7.0 label Mar 19, 2019
@w33ble w33ble removed their assignment Jun 12, 2019
@clintandrewhall clintandrewhall added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Canvas impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:medium Medium Level of Effort performance Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

8 participants