[8.19] [Investigations][DataViews] - Remove non-performant toSpec usage (#225726)#228346
Merged
michaelolo24 merged 5 commits intoelastic:8.19from Jul 17, 2025
Merged
Conversation
…stic#225726) ## Summary This PR looks to improve the performance of the application by using `DataView` in place of `DataViewSpec`. The currently used `DataViewSpec` turns out to not be performant at scale because it lacks caching, and performs quite a few nested iterations in the [DataView.toSpec](https://github.com/elastic/kibana/blob/27183690142a5590b4ad72d060c43cad869f3f3c/src/platform/plugins/shared/data_views/common/data_views/data_view.ts#L147) call as seen [here](https://github.com/elastic/kibana/blob/27183690142a5590b4ad72d060c43cad869f3f3c/src/platform/plugins/shared/data_views/common/data_views/abstract_data_views.ts#L391-L422), [here](https://github.com/elastic/kibana/blob/27183690142a5590b4ad72d060c43cad869f3f3c/src/platform/plugins/shared/data_views/common/fields/field_list.ts#L157-L159), and finally [here](https://github.com/elastic/kibana/blob/27183690142a5590b4ad72d060c43cad869f3f3c/src/platform/plugins/shared/data_views/common/fields/data_view_field.ts#L438-L440). While this may not be a significant issue at a few thousand fields, this does not scale well as the number of fields reaches the tens/hundreds of thousands. This PR makes the change to rely on the DataView instance directly, which is cached in memory. These performance impacts aren't seen currently as the new framework is currently disabled behind the below feature flag. ** Relevant configurations ** `xpack.securitySolution.enableExperimental: ['newDataViewPickerEnabled']` --------- Co-authored-by: PhilippeOberti <philippe.oberti@elastic.co> (cherry picked from commit 6294df6) # Conflicts: # x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/index.tsx # x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/index.tsx # x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx # x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_toolbar_controls.tsx # x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx # x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/detection_engine.tsx # x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_management/risk_score_preview_section.tsx # x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx # x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_privileged_user_monitoring_page.tsx # x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/index.tsx # x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.tsx # x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.tsx # x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/index.tsx
dplumlee
approved these changes
Jul 16, 2025
Contributor
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]
History
|
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.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation