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

[Lens] More memoization work on the editor_frame #102186

Merged
merged 4 commits into from
Jun 17, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jun 15, 2021

Summary

This is some more React reference stabilisation work.
I've managed to reduce a big some re-render issues on the indexpattern dimension panel side, via some memoization work.
Will probably push some more memoization upstream on the EUI level as well.

Tested with slowdown 4x and 6x as well.
Noticed that, in general, referenced operations when in formula are way too expensive compared to others.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v7.14.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Jun 15, 2021
@dej611
Copy link
Contributor Author

dej611 commented Jun 16, 2021

@elasticmachine merge upstream

layerId: newLayerId,
updater: props.datasourceMap[state.activeDatasourceId!].insertLayer,
});
const framePublicAPI: FramePublicAPI = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a ref here would be even better, but it requires way more refactoring than just this place.

@dej611 dej611 marked this pull request as ready for review June 16, 2021 10:30
@dej611 dej611 requested a review from a team June 16, 2021 10:30
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@dej611
Copy link
Contributor Author

dej611 commented Jun 16, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.5MB 1.5MB +827.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and everything still works fine

@dej611 dej611 merged commit 421493c into elastic:master Jun 17, 2021
@dej611 dej611 deleted the lens/more-perf-memoization branch June 17, 2021 13:47
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 17, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 17, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
majagrubic pushed a commit to majagrubic/kibana that referenced this pull request Jun 18, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants