[WIP] - Add dataview cache to toSpec call#223466
Closed
michaelolo24 wants to merge 1 commit intoelastic:mainfrom
Closed
[WIP] - Add dataview cache to toSpec call#223466michaelolo24 wants to merge 1 commit intoelastic:mainfrom
michaelolo24 wants to merge 1 commit intoelastic:mainfrom
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Contributor
|
Project deployments require a Github label, please add one or more of |
e5bdfa4 to
e81ab95
Compare
e81ab95 to
7fe47e5
Compare
Contributor
|
Cloud deployment initiated, see credentials at: https://buildkite.com/elastic/kibana-deploy-cloud-from-pr/builds/255 |
Contributor
Author
|
/ci |
Contributor
💔 Build Failed
Failed CI StepsHistory
|
Contributor
Author
|
closing in favor of: #224767 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a basic cache for the
.toSpec()call of a DataView instance. The rationale behind this is due to the potential performance impact of these calls when fields are included. Often this isn't seen in local development, but when testing with enough fields (500K+), this can be significantly noticeable.This is much older code, but in security we've worked around this by essentially caching the basic fields necessary for the spec here and then passing that around through the application here to be able to generate dataViews via
new DataView(sourcererSpec). We're updating this logic to get the actual dataviews viadataViews.getand making use ofdataView.toSpecto rely on the up to date fields from that call, rather than caching them separately in redux, Unfortunately this may introduce performance impacts due to the necessity for fields in many of our components and caching not being built in to the class.We can keep our current redux pattern, but we would like to rely on the DataView service more rather than having workaround.
Prior art: https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-lens-embeddable-utils/attribute_builder/data_view_cache.ts
Similar approach here based on our dataView refactoring.