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

Add var generation benchmark #6028

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Nov 14, 2024

What does this PR do?

Add a benchmark for variable generation from provider mappings. We specifically profile having a lot of Pods from the Kubernetes provider, which is something that has recently become a problem, and which the configuration generation pipeline doesn't deal with very well. I used test data from a real environment where the problems outlined in #5991 and #5835 could be reproduced.

Results on main:

goos: linux
goarch: amd64
pkg: github.com/elastic/elastic-agent/internal/pkg/composable
cpu: 13th Gen Intel(R) Core(TM) i7-13700H
BenchmarkGenerateVars100Pods-20    	      74	  15310045 ns/op	10527199 B/op	  201283 allocs/op
BenchmarkGenerateVars100Pods-20    	      74	  15185648 ns/op	10514404 B/op	  201271 allocs/op
BenchmarkGenerateVars100Pods-20    	      86	  15126049 ns/op	10521262 B/op	  201277 allocs/op
BenchmarkGenerateVars100Pods-20    	      87	  15067870 ns/op	10514019 B/op	  201275 allocs/op
BenchmarkGenerateVars100Pods-20    	      85	  15032633 ns/op	10515568 B/op	  201274 allocs/op
BenchmarkGenerateVars100Pods-20    	      90	  15185170 ns/op	10525087 B/op	  201282 allocs/op
BenchmarkGenerateVars100Pods-20    	      75	  15345854 ns/op	10516840 B/op	  201274 allocs/op
BenchmarkGenerateVars100Pods-20    	      80	  15908398 ns/op	10518576 B/op	  201277 allocs/op
BenchmarkGenerateVars100Pods-20    	      73	  15623320 ns/op	10529545 B/op	  201284 allocs/op
BenchmarkGenerateVars100Pods-20    	      86	  15946078 ns/op	10533571 B/op	  201286 allocs/op
PASS
ok  	github.com/elastic/elastic-agent/internal/pkg/composable	12.832s

Why is it important?

I'd like to make some improvements to both the var generation and the configuration generation in the coordinator, and want a straightforward way of demonstrating their impact.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

Related issues

@swiatekm swiatekm added skip-changelog Testing chore Tasks that just need to be done, they are neither bug, nor enhancements labels Nov 14, 2024
@swiatekm swiatekm requested a review from a team as a code owner November 14, 2024 14:25
Copy link
Contributor

mergify bot commented Nov 14, 2024

This pull request does not have a backport label. Could you fix it @swiatekm? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Nov 14, 2024

backport-v8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Nov 14, 2024
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Nov 14, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Nice!

Really like seeing ways to quantify the improvements.

@swiatekm swiatekm added the skip-it Skips integration tests for a PR label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify chore Tasks that just need to be done, they are neither bug, nor enhancements skip-changelog skip-it Skips integration tests for a PR Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants