elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.49k stars 8.05k forks source link

[Security Solution] Large number of related integrations can impact performance on rule creation/edit form #183607

Open vitaliidm opened 2 months ago

vitaliidm commented 2 months ago

Epics: https://github.com/elastic/security-team/issues/1974 (internal), https://github.com/elastic/kibana/issues/174168

Summary

Describe the bug: Large number of related integrations can cause significant performance impact on rule creation/edit form.

Steps to reproduce:

  1. Go to rule edit/create form
  2. Add multiple related integrations
  3. Type query in query bar. There is a noticeable delay in response on browser page
  4. Observe in profiler, related integrations could take up to up to 10ms to re-render on each symbol typed. Potentially, even longer, if more added.

Current behavior: Each added item to related integrations contribute to the total time of form re-rendering. Component re-renders on any change in form. So, even typing query, that does not effect state of related integrations, causes this component to re-render. Each added item, adds approx. 1ms in rendering time. For 8 items it takes 8ms, out of 30ms of total form re-render time.

Expected behavior: Component should not re-render when thee are no changes in form that affect it. Similar issue was discovered for required fields and handled in relevant PR

Screenshots (if relevant):

Screenshot 2024-05-16 at 10 19 30
elasticmachine commented 2 months ago

Pinging @elastic/security-solution (Team: SecuritySolution)

elasticmachine commented 2 months ago

Pinging @elastic/security-detection-engine (Team:Detection Engine)

yctercero commented 1 month ago

Hey @banderror ! Would it be ok to assign this one to Rules Management to look into?

banderror commented 1 month ago

@yctercero Of course, it's the feature we added so we'll address the performance concerns as well. Thank you @vitaliidm!

elasticmachine commented 1 month ago

Pinging @elastic/security-detections-response (Team:Detections and Resp)

elasticmachine commented 1 month ago

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)