Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Security Solution] Security Alert Table Performance Optimizati…
…ons (#192827) (#195935) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Security Alert Table Performance Optimizations (#192827)](#192827) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-11T14:29:58Z","message":"[Security Solution] Security Alert Table Performance Optimizations (#192827)\n\n## Summary\r\n\r\nThere are few performance issues with Security's alert table today which\r\nthis PR aims to fix.\r\n\r\n1. Virtualization was not working in Grid View and Event Rendered View.\r\nConstraining the height of `EuiDataGrid` makes virtualization work.\r\n2. It was taking lot of time when switching between Event Rendered View\r\nand Grid view.\r\n\r\nBelow we compare some performance metric in both above scenarios.\r\n\r\n## Solution\r\n\r\n- Solution was to enable virtualization but bounding the height of the\r\ntable.\r\n- If number of rows < 10, then height is `auto` else it maxed at `600px`\r\n\r\n## Grid View - 100 Rows - Changing Query\r\n\r\nIf you compare times below for rendering of Alert Table Components, we\r\nsee that improvement is of 2.5-5 times.\r\n\r\nNumber of re-renders are also fewer.\r\n\r\n### Before\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/c2e14b24-750b-4c7c-981f-d7fde85cfeff)\r\n\r\n\r\n### After\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/8eab15e2-4e93-41c3-88fe-bdadb367785d)\r\n\r\n\r\n## Grid View - 100 Rows - Changing view to Event Rendered View\r\n\r\nEvent Rendered View is where these optimization actually shine. If you\r\nobserve the rendering times, performance gain is upto 10 times for all\r\nrenders. Number of re-renders are also reduced.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/5cba7d86-6b71-496a-9004-8ce5b3599f4e)\r\n\r\n\r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/db9d07fa-2afe-4f3d-8261-cc16d40165bc)\r\n\r\n\r\n## Grid View - Change page size from 20 rows to 100 rows\r\n\r\nHere also we achieve almost 15 times improvement in the render times of\r\nthe table.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/a8a3467a-7774-4d02-ab4c-80433aa99660)\r\n\r\n \r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/1c9a8645-7fbd-49f2-b72b-83d8688decbc)\r\n\r\n\r\n## Desk Testing Guide\r\n\r\nBelow scenarios need to tested to make sure Alert Table is working fine\r\nin both Grid View and Event Rendered View\r\n\r\n1. Alert Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n3. Rule Details Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n5. Full Screen.\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n7. Number of records < 10\r\n - should resize the table to fit the content.\r\n8. Number of records > 10\r\n - should have fixed height and no-virtualization enabled.\r\n9. Change view from Event Rendered View\r\n10. Increase rows from default of `20` to `100`","sha":"a84d62dce6f386ef114ef25a99d2b7e0c56719c2","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Threat Hunting:Investigations","backport:prev-minor"],"title":"[Security Solution] Security Alert Table Performance Optimizations","number":192827,"url":"https://github.com/elastic/kibana/pull/192827","mergeCommit":{"message":"[Security Solution] Security Alert Table Performance Optimizations (#192827)\n\n## Summary\r\n\r\nThere are few performance issues with Security's alert table today which\r\nthis PR aims to fix.\r\n\r\n1. Virtualization was not working in Grid View and Event Rendered View.\r\nConstraining the height of `EuiDataGrid` makes virtualization work.\r\n2. It was taking lot of time when switching between Event Rendered View\r\nand Grid view.\r\n\r\nBelow we compare some performance metric in both above scenarios.\r\n\r\n## Solution\r\n\r\n- Solution was to enable virtualization but bounding the height of the\r\ntable.\r\n- If number of rows < 10, then height is `auto` else it maxed at `600px`\r\n\r\n## Grid View - 100 Rows - Changing Query\r\n\r\nIf you compare times below for rendering of Alert Table Components, we\r\nsee that improvement is of 2.5-5 times.\r\n\r\nNumber of re-renders are also fewer.\r\n\r\n### Before\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/c2e14b24-750b-4c7c-981f-d7fde85cfeff)\r\n\r\n\r\n### After\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/8eab15e2-4e93-41c3-88fe-bdadb367785d)\r\n\r\n\r\n## Grid View - 100 Rows - Changing view to Event Rendered View\r\n\r\nEvent Rendered View is where these optimization actually shine. If you\r\nobserve the rendering times, performance gain is upto 10 times for all\r\nrenders. Number of re-renders are also reduced.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/5cba7d86-6b71-496a-9004-8ce5b3599f4e)\r\n\r\n\r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/db9d07fa-2afe-4f3d-8261-cc16d40165bc)\r\n\r\n\r\n## Grid View - Change page size from 20 rows to 100 rows\r\n\r\nHere also we achieve almost 15 times improvement in the render times of\r\nthe table.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/a8a3467a-7774-4d02-ab4c-80433aa99660)\r\n\r\n \r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/1c9a8645-7fbd-49f2-b72b-83d8688decbc)\r\n\r\n\r\n## Desk Testing Guide\r\n\r\nBelow scenarios need to tested to make sure Alert Table is working fine\r\nin both Grid View and Event Rendered View\r\n\r\n1. Alert Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n3. Rule Details Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n5. Full Screen.\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n7. Number of records < 10\r\n - should resize the table to fit the content.\r\n8. Number of records > 10\r\n - should have fixed height and no-virtualization enabled.\r\n9. Change view from Event Rendered View\r\n10. Increase rows from default of `20` to `100`","sha":"a84d62dce6f386ef114ef25a99d2b7e0c56719c2"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192827","number":192827,"mergeCommit":{"message":"[Security Solution] Security Alert Table Performance Optimizations (#192827)\n\n## Summary\r\n\r\nThere are few performance issues with Security's alert table today which\r\nthis PR aims to fix.\r\n\r\n1. Virtualization was not working in Grid View and Event Rendered View.\r\nConstraining the height of `EuiDataGrid` makes virtualization work.\r\n2. It was taking lot of time when switching between Event Rendered View\r\nand Grid view.\r\n\r\nBelow we compare some performance metric in both above scenarios.\r\n\r\n## Solution\r\n\r\n- Solution was to enable virtualization but bounding the height of the\r\ntable.\r\n- If number of rows < 10, then height is `auto` else it maxed at `600px`\r\n\r\n## Grid View - 100 Rows - Changing Query\r\n\r\nIf you compare times below for rendering of Alert Table Components, we\r\nsee that improvement is of 2.5-5 times.\r\n\r\nNumber of re-renders are also fewer.\r\n\r\n### Before\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/c2e14b24-750b-4c7c-981f-d7fde85cfeff)\r\n\r\n\r\n### After\r\n\r\n\r\n![grafik](https://github.com/user-attachments/assets/8eab15e2-4e93-41c3-88fe-bdadb367785d)\r\n\r\n\r\n## Grid View - 100 Rows - Changing view to Event Rendered View\r\n\r\nEvent Rendered View is where these optimization actually shine. If you\r\nobserve the rendering times, performance gain is upto 10 times for all\r\nrenders. Number of re-renders are also reduced.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/5cba7d86-6b71-496a-9004-8ce5b3599f4e)\r\n\r\n\r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/db9d07fa-2afe-4f3d-8261-cc16d40165bc)\r\n\r\n\r\n## Grid View - Change page size from 20 rows to 100 rows\r\n\r\nHere also we achieve almost 15 times improvement in the render times of\r\nthe table.\r\n\r\n### Before\r\n\r\n![grafik](https://github.com/user-attachments/assets/a8a3467a-7774-4d02-ab4c-80433aa99660)\r\n\r\n \r\n### After\r\n\r\n![grafik](https://github.com/user-attachments/assets/1c9a8645-7fbd-49f2-b72b-83d8688decbc)\r\n\r\n\r\n## Desk Testing Guide\r\n\r\nBelow scenarios need to tested to make sure Alert Table is working fine\r\nin both Grid View and Event Rendered View\r\n\r\n1. Alert Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n3. Rule Details Page\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n - Alert Table when grouping is enabled.\r\n5. Full Screen.\r\n - Analyzer is working fine\r\n - Session Viewer is working fine\r\n7. Number of records < 10\r\n - should resize the table to fit the content.\r\n8. Number of records > 10\r\n - should have fixed height and no-virtualization enabled.\r\n9. Change view from Event Rendered View\r\n10. Increase rows from default of `20` to `100`","sha":"a84d62dce6f386ef114ef25a99d2b7e0c56719c2"}}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <[email protected]>
- Loading branch information