-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Improve plugin bundle load time #55241
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Just a side note: we will have the same problem with CSS files. The solution should work for both types.
Should we measure delays for the prod bundle after minification and gzip to understand how critical the problem is?
it looks like a correct way. HTTP2 issue #7104 |
I this a significant gain though? What is the delay between dom-ready and
Sure is an improvement |
In 7.7 Kibana performs 145 requests on bootstrap (as per #62263 (comment)). There are some quick wins that we can do to reduce the number of downloaded artifacts:
|
the icon files are now bundled into the |
This will be dramatically cut down by #61011 so probably not worth revisiting right now. When we render NP apps, we will no longer load CSS files from DLLs or legacy uiExports. |
This seems like a prime target for optimization right now. These shouldn't have any problems being concatenated, though you may need to be careful with the new shared bundles with esUiShared and kibanaUtils. The tricky part is figuring out the right approach. Can we get away with reading all of these files at request time or is this too slow do we need to pre-concatenate these? If we need to pre-concatenate at server boot time, we'll need to either 1) always re-run this process on every startup; or 2) only re-run when the list of enabled plugins changes. I took a quick try at this a few weeks back and ran into issues in development with serving a file that was over 25MB. The server would stop streaming the bytes to the client after it hit a certain number. I didn't go deep into figuring out why this was happening, but I did rule out the public path replacement logic we have. Increasing the stream buffer size also did not fix. Though that issue on its own may not be worth solving because we probably will need to chunk this concatenated file out anyways. We've encountered bugs in the past where browsers won't cache files over a certain size in incognito/private mode. Chunking into smaller files helps. This feels like a goldilocks problem...not too small, not too big, juuuust right 😄 |
As it only depends on the enabled plugins, I don't see any reason not to do it at startup?
Either is fine, even if imho this is not going to really be resource consuming and therefor probably way simpler to do with option 1)
One option would be to define a limit on how big a file can be, and then generate multiple files, by switching to a new aggregated file once we hit the limit. This still is a little more complex than generating only one file, as the client needs to have the information of the names / number of files to fetch them, so the info will need to be sent from the server or present somewhere in the html template. |
That's true. However, most apps are still in LP for a release or two, so this improvement still could be beneficial. |
superseded by cache busting in #64414 |
When auditing the startup performance of the New Platform Core on the client, I noticed that the bulk of the time is spent loading plugin bundles (~1.5s locally).
Currently, plugin bundles are not loaded until the
PluginsService#setup
method is called, which reads the list of enabled plugins from injected metadata and then adds<script>
tags to the page for each plugin that needs to be loaded. This has two problems:This could be made faster by:
The text was updated successfully, but these errors were encountered: