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

[Discover] improve initial loading of data views #211208

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

kertal
Copy link
Member

@kertal kertal commented Feb 14, 2025

Summary

This PR optimizes the way Discover interacts with data views, enhancing performance and simplifying code management.

Key Improvements

  1. Faster Navigation: Eliminates the initial data view loading when accessing Discover
  2. Enhanced ES|QL Performance: Particularly benefits users of ES|QL mode by removing an unnecessary data view requests, subtracting the duration of this request from the intial loading of Discover in ES|QL mode
  3. Code Simplification: Removes redundant code and simplifies legacy state management (and new state management also doesn't need this functionality )

This change aligns with our ongoing efforts to optimize Kibana's performance.

Checklist

@kertal kertal self-assigned this Feb 14, 2025
@kertal
Copy link
Member Author

kertal commented Feb 14, 2025

/ci

@kertal
Copy link
Member Author

kertal commented Feb 17, 2025

/ci

@kertal
Copy link
Member Author

kertal commented Feb 17, 2025

/ci

@kertal
Copy link
Member Author

kertal commented Feb 17, 2025

/ci

@kertal
Copy link
Member Author

kertal commented Feb 17, 2025

/ci

1 similar comment
@kertal
Copy link
Member Author

kertal commented Feb 18, 2025

/ci

@kertal kertal added Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Feb 18, 2025
@kertal
Copy link
Member Author

kertal commented Feb 24, 2025

/ci

@kertal
Copy link
Member Author

kertal commented Feb 24, 2025

@akowalska622 remember we've talked about this, mentioning chaos theory last week, when tests start to fail for very odd reasons.... the solution here was easy ... merge main, seems it has been fixed 🤔

@kertal kertal added performance backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes labels Feb 24, 2025
@akowalska622
Copy link
Contributor

@akowalska622 remember we've talked about this, mentioning chaos theory last week, when tests start to fail for very odd reasons.... the solution here was easy ... merge main, seems it has been fixed 🤔

Happens to me too often hehe! 🐲

@kertal
Copy link
Member Author

kertal commented Feb 28, 2025

/ci

Comment on lines +1323 to +1324
this.dataViewCache.set(indexPattern.id, Promise.resolve(indexPattern as DataView));
this.dataViewLazyCache.set(indexPattern.id, Promise.resolve(indexPattern as DataViewLazy));
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need to load the list or clean the cache in Discover, if the cache is also updated when a data view is updated, e.g. change of name.

@kertal
Copy link
Member Author

kertal commented Feb 28, 2025

/ci

@kertal kertal changed the title [Discover] improve list loading of data views [Discover] improve initial loading of data views Feb 28, 2025
@kertal kertal marked this pull request as ready for review February 28, 2025 13:52
@kertal kertal requested a review from a team as a code owner February 28, 2025 13:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal
Copy link
Member Author

kertal commented Mar 3, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

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
discover 810.8KB 810.3KB -426.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dataViews 62.0KB 62.1KB +100.0B

History

cc @kertal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Discover Discover Application performance release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants