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

[Performance][Security Solution][3/4] - Sourcerer performance #212482

Merged

Conversation

michaelolo24
Copy link
Contributor

@michaelolo24 michaelolo24 commented Feb 26, 2025

Summary

Part 3 of #212173

Testing

For setup see testing section here: #212173 (comment)

Testing this work is a bit more console.log related, as the primary aim of many of these changes was to limit the amount of re-renders caused by state changes within many of the sourcerer utils. React is relatively fast at handling many of these re-renders, but considering the widespread usage of useSourcererDataView and the top level location of useInitSourcerer, it was worth taking care of some low hanging fruit.

Background

The changes in this PR centered around limiting the number of re-renders that were being caused unnecessarily in useSourcererDataView and useInitSourcerer by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

Identify risks

@michaelolo24 michaelolo24 added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Threat Hunting:Investigations Security Solution Investigations Team backport:all-open Backport to all branches that could still receive a release v9.1.0 v8.19.0 labels Feb 26, 2025
@@ -67,10 +67,11 @@ export const useSourcererDataView = (
if (selectedDataView == null || missingPatterns.length > 0) {
// old way of fetching indices, legacy timeline
setLegacyPatterns(selectedPatterns);
} else {
} else if (legacyPatterns.length > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sourcerer was unnecessarily re-rendering due to a reference change that took place because of an empty array being replaced with a new empty array. It could also be solved by pulling out a const emptyArray = [] and re-using that but just went with the if check instead...

@@ -370,4 +370,11 @@ export const useInitSourcerer = (
signalIndexName,
signalIndexNameSourcerer,
]);

return useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

return browser fields from useInitSourcerer as there was another call to useSourcererDataView in the home component that only returned browser fields...and we already made that call in the useInit, so now we just return it from there instead.

Other change here:
https://github.com/elastic/kibana/pull/212482/files#diff-c46dd8c3c8b81dc65ae1d303e29c3c0e966fcd5e4588731828b46142b18d494aL42

@michaelolo24 michaelolo24 marked this pull request as ready for review February 26, 2025 16:55
@michaelolo24 michaelolo24 requested review from a team as code owners February 26, 2025 16:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations)

@@ -240,14 +240,14 @@ export const useInitSourcerer = (
);
}
}, [
activeTimeline,
activeTimeline?.savedObjectId,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we only care about the id value, don't re call due to activeTimeline ref changes.

@michaelolo24
Copy link
Contributor Author

/ci

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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
securitySolution 8.9MB 8.9MB -158.0B

History

@michaelolo24 michaelolo24 merged commit 98b5280 into elastic:main Mar 3, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 7.17, 8.16, 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13640409812

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…c#212482)

## Summary
Part 3 of elastic#212173

### Testing
For setup see testing section here:
elastic#212173 (comment)

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98b5280)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…c#212482)

## Summary
Part 3 of elastic#212173

### Testing
For setup see testing section here:
elastic#212173 (comment)

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98b5280)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…c#212482)

## Summary
Part 3 of elastic#212173

### Testing
For setup see testing section here:
elastic#212173 (comment)

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98b5280)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…c#212482)

## Summary
Part 3 of elastic#212173

### Testing
For setup see testing section here:
elastic#212173 (comment)

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98b5280)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…c#212482)

## Summary
Part 3 of elastic#212173

### Testing
For setup see testing section here:
elastic#212173 (comment)

Testing this work is a bit more `console.log` related, as the primary
aim of many of these changes was to limit the amount of re-renders
caused by state changes within many of the sourcerer utils. React is
relatively fast at handling many of these re-renders, but considering
the widespread usage of `useSourcererDataView` and the top level
location of `useInitSourcerer`, it was worth taking care of some low
hanging fruit.

### Background

The changes in this PR centered around limiting the number of re-renders
that were being caused unnecessarily in `useSourcererDataView` and
`useInitSourcerer` by identifying some quick wins.

Comments regarding the changes can be found in the PR diffs

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
### Identify risks

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 98b5280)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.16
8.17
8.18
8.x
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 212482

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 3, 2025
…212482) (#212989)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Performance][Security Solution][3/4] - Sourcerer performance
(#212482)](#212482)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T21:06:38Z","message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:all-open","v8.18.0","v9.1.0","v8.19.0"],"title":"[Performance][Security
Solution][3/4] - Sourcerer
performance","number":212482,"url":"https://github.com/elastic/kibana/pull/212482","mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212482","number":212482,"mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 3, 2025
…212482) (#212988)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Performance][Security Solution][3/4] - Sourcerer performance
(#212482)](#212482)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T21:06:38Z","message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:all-open","v8.18.0","v9.1.0","v8.19.0"],"title":"[Performance][Security
Solution][3/4] - Sourcerer
performance","number":212482,"url":"https://github.com/elastic/kibana/pull/212482","mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212482","number":212482,"mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 3, 2025
…212482) (#212985)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Performance][Security Solution][3/4] - Sourcerer performance
(#212482)](#212482)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T21:06:38Z","message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:all-open","v8.18.0","v9.1.0","v8.19.0"],"title":"[Performance][Security
Solution][3/4] - Sourcerer
performance","number":212482,"url":"https://github.com/elastic/kibana/pull/212482","mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212482","number":212482,"mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 3, 2025
…212482) (#212986)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Performance][Security Solution][3/4] - Sourcerer performance
(#212482)](#212482)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T21:06:38Z","message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:all-open","v8.18.0","v9.1.0","v8.19.0"],"title":"[Performance][Security
Solution][3/4] - Sourcerer
performance","number":212482,"url":"https://github.com/elastic/kibana/pull/212482","mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212482","number":212482,"mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com//pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 4, 2025
…lastic#212482) (elastic#212988)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Performance][Security Solution][3/4] - Sourcerer performance
(elastic#212482)](elastic#212482)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Michael
Olorunnisola","email":"michael.olorunnisola@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T21:06:38Z","message":"[Performance][Security
Solution][3/4] - Sourcerer performance (elastic#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com/elastic/pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting:Investigations","backport:all-open","v8.18.0","v9.1.0","v8.19.0"],"title":"[Performance][Security
Solution][3/4] - Sourcerer
performance","number":212482,"url":"https://github.com/elastic/kibana/pull/212482","mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (elastic#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com/elastic/pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212482","number":212482,"mergeCommit":{"message":"[Performance][Security
Solution][3/4] - Sourcerer performance (elastic#212482)\n\n## Summary\nPart 3
of https://github.com/elastic/kibana/pull/212173\n\n### Testing\nFor
setup see testing section
here:\nhttps://github.com/elastic/pull/212173#issue-2870522020\n\nTesting
this work is a bit more `console.log` related, as the primary\naim of
many of these changes was to limit the amount of re-renders\ncaused by
state changes within many of the sourcerer utils. React is\nrelatively
fast at handling many of these re-renders, but considering\nthe
widespread usage of `useSourcererDataView` and the top level\nlocation
of `useInitSourcerer`, it was worth taking care of some low\nhanging
fruit.\n\n### Background\n\nThe changes in this PR centered around
limiting the number of re-renders\nthat were being caused unnecessarily
in `useSourcererDataView` and\n`useInitSourcerer` by identifying some
quick wins.\n\nComments regarding the changes can be found in the PR
diffs\n\n\n### Checklist\n\nCheck the PR satisfies following conditions.
\n\nReviewers should verify this PR satisfies this list as well.\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n### Identify
risks\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"98b52804d500f31f2fc80f47f478427a52f20630"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
@mistic
Copy link
Member

mistic commented Mar 4, 2025

This PR didn't make it into the latest BC of v8.17.3. Updating the labels accordingly.

@mistic mistic added v8.17.4 and removed v8.17.3 labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.17.4 v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants