Skip to content

[index management] Component template api performance fixes#228709

Merged
mattkime merged 2 commits intomainfrom
component_template_get_api_go_faster
Jul 21, 2025
Merged

[index management] Component template api performance fixes#228709
mattkime merged 2 commits intomainfrom
component_template_get_api_go_faster

Conversation

@mattkime
Copy link
Contributor

@mattkime mattkime commented Jul 21, 2025

Summary

This implements two performance improvements - first, firing both requests in parallel instead of in sequence. The second one, doing the real work - for each component template the list of index templates was being transformed via map. If you have hundreds of one and thousands of another it gets VERY slow. 30s on my machine but up to a minute for a customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index templates -
new_import.py.txt

Run the above script against main and open the component template tab - it will be VERY slow. Now do it against this branch. Hopefully you notice a significant speed increase.

Closes #228267


Release note

Index Management component template tab speed increase

@mattkime mattkime self-assigned this Jul 21, 2025
@mattkime mattkime requested a review from a team as a code owner July 21, 2025 04:38
@mattkime mattkime added Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// labels Jul 21, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@mattkime mattkime added bug Fixes for quality problems that affect the customer experience release_note:fix backport:all-open Backport to all branches that could still receive a release labels Jul 21, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @mattkime

Copy link
Contributor

@SoniaSanzV SoniaSanzV left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this. Tested locally and it is significantly faster. LGTM.

@mattkime mattkime merged commit 8f5825c into main Jul 21, 2025
22 checks passed
@mattkime mattkime deleted the component_template_get_api_go_faster branch July 21, 2025 11:30
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 21, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase

(cherry picked from commit 8f5825c)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 21, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase

(cherry picked from commit 8f5825c)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 21, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase

(cherry picked from commit 8f5825c)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 21, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase

(cherry picked from commit 8f5825c)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 21, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase

(cherry picked from commit 8f5825c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.18
8.19
9.0
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 21, 2025
…28709) (#228761)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[index management] Component template api performance fixes
(#228709)](#228709)

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

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-07-21T11:30:07Z","message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Kibana
Management","Team:Kibana
Management","backport:all-open","v9.2.0"],"title":"[index management]
Component template api performance
fixes","number":228709,"url":"https://github.com/elastic/kibana/pull/228709","mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228709","number":228709,"mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
kibanamachine added a commit that referenced this pull request Jul 21, 2025
…228709) (#228757)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[index management] Component template api performance fixes
(#228709)](#228709)

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

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-07-21T11:30:07Z","message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Kibana
Management","Team:Kibana
Management","backport:all-open","v9.2.0"],"title":"[index management]
Component template api performance
fixes","number":228709,"url":"https://github.com/elastic/kibana/pull/228709","mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228709","number":228709,"mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase
kibanamachine added a commit that referenced this pull request Jul 22, 2025
…28709) (#228760)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[index management] Component template api performance fixes
(#228709)](#228709)

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

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-07-21T11:30:07Z","message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Kibana
Management","Team:Kibana
Management","backport:all-open","v9.2.0"],"title":"[index management]
Component template api performance
fixes","number":228709,"url":"https://github.com/elastic/kibana/pull/228709","mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228709","number":228709,"mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
kibanamachine added a commit that referenced this pull request Jul 22, 2025
…228709) (#228759)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[index management] Component template api performance fixes
(#228709)](#228709)

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

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-07-21T11:30:07Z","message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Kibana
Management","Team:Kibana
Management","backport:all-open","v9.2.0"],"title":"[index management]
Component template api performance
fixes","number":228709,"url":"https://github.com/elastic/kibana/pull/228709","mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228709","number":228709,"mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
@mistic mistic added v9.0.5 and removed v9.0.4 labels Jul 22, 2025
@mistic
Copy link
Contributor

mistic commented Jul 22, 2025

This PR didn't make it on time into the latest v9.0.5 BC. Updating the labels.

@mistic mistic added v8.17.10 and removed v8.17.9 labels Jul 22, 2025
kibanamachine added a commit that referenced this pull request Jul 22, 2025
…228709) (#228758)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[index management] Component template api performance fixes
(#228709)](#228709)

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

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2025-07-21T11:30:07Z","message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Kibana
Management","Team:Kibana
Management","backport:all-open","v9.2.0"],"title":"[index management]
Component template api performance
fixes","number":228709,"url":"https://github.com/elastic/kibana/pull/228709","mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228709","number":228709,"mergeCommit":{"message":"[index
management] Component template api performance fixes (#228709)\n\n##
Summary\n\nThis implements two performance improvements - first, firing
both\nrequests in parallel instead of in sequence. The second one, doing
the\nreal work - for each component template the list of index templates
was\nbeing transformed via `map`. If you have hundreds of one and
thousands\nof another it gets VERY slow. 30s on my machine but up to a
minute for a\ncustomer.\n\nAfter this change the performance went from
30s to 500ms.\n\nPython script for generating necessary set of component
and index\ntemplates
-\n\n[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)\n\nRun
the above script against main and open the component template tab -\nit
will be VERY slow. Now do it against this branch. Hopefully you\nnotice
a significant speed increase.\n\nCloses
https://github.com/elastic/kibana/issues/228267\n\n---\n\nRelease
note\n\nIndex Management component template tab speed
increase","sha":"8f5825c80584cb10109fa83b034ad46bbebab61e"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
@mattkime
Copy link
Contributor Author

@mistic It might be worth reviewing your label updates. If this didn't make 9.0.5 then it would be in 9.0.6. Not sure if this made 8.18.5 either

kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jul 25, 2025
…228709)

## Summary

This implements two performance improvements - first, firing both
requests in parallel instead of in sequence. The second one, doing the
real work - for each component template the list of index templates was
being transformed via `map`. If you have hundreds of one and thousands
of another it gets VERY slow. 30s on my machine but up to a minute for a
customer.

After this change the performance went from 30s to 500ms.

Python script for generating necessary set of component and index
templates -

[new_import.py.txt](https://github.com/user-attachments/files/21340591/new_import.py.txt)

Run the above script against main and open the component template tab -
it will be VERY slow. Now do it against this branch. Hopefully you
notice a significant speed increase.

Closes elastic#228267

---

Release note

Index Management component template tab speed increase
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 bug Fixes for quality problems that affect the customer experience Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages release_note:fix Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.17.10 v8.18.4 v8.19.0 v9.0.5 v9.1.0 v9.2.0

5 participants