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

Lazy-load visualizations #58280

Closed
7 tasks
flash1293 opened this issue Feb 21, 2020 · 4 comments
Closed
7 tasks

Lazy-load visualizations #58280

flash1293 opened this issue Feb 21, 2020 · 4 comments
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Meta Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

flash1293 commented Feb 21, 2020

With the new platform, soon all visualizations will be loaded for each page/app a user loads because registerings are ran in the setup phase and pull in the definition of a visulization which also contains the render logic. Currently there is no lazy dynamic import step in there to load the heavy part of visualizations only when actually required to render. Especially for visualization types like vega or timelion which rely on complete rendering libraries under the hood not used anywhere else, this can bloat the amount of Javascript evaluated when Kibana is loaded and slow down the startup.

Tasks:

  • Validate the impact of loading all visualizations with their complete implementation up front whether the effort is even worth it. If it is...
  • Check whether the visualizations registry can be improved somehow to make this task easier
  • Discuss with app arch team and implement if appropriate
  • Lazy-load vega
  • Lazy-load timelion
  • Lazy-load vislib
  • Lazy-load tagcloud
  • Lazy-load TSVB
  • Lazy-load markdown
  • Lazy-loading in Lens
@flash1293 flash1293 added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure Team:AppArch labels Feb 21, 2020
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@mshustov
Copy link
Contributor

mshustov commented Apr 23, 2020

plugin bundle sizes in the master branch for a reference:
vis_type_vega - 2Kb (empty atm)
vis_type_xy - 4Kb (empty atm)
vis_type_timelion - 2.1Mb
vis_type_metric - 2.4Mb
vis_type_table - 2.3Mb
vis_type_cloud - 2.3Mb
vis_type_timeseries - 4Mb
vis_type_markdown - 2.8Mb
lens - 3Mb

All that code is loaded eagerly on Kibana bootstrap.
https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md#how-to-understand-how-big-the-bundle-size-of-my-plugin-is

other plugins owned by @elastic/kibana-app
dashboard - 2.2Mb
visualize - 2Mb

@timroes
Copy link
Contributor

timroes commented Oct 8, 2020

Closing this in favor of #46801.

We're making all visualization renderers importing async during giving each their own renderer. Also most editors are already made async nowadays.

@timroes timroes closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Meta Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants