Skip to content

enhancement(host_tags): don't allocate vector to hold tags before resolving#672

Merged
tobz merged 2 commits intomainfrom
tobz/host-tags-borrowing-tags-iter
May 8, 2025
Merged

enhancement(host_tags): don't allocate vector to hold tags before resolving#672
tobz merged 2 commits intomainfrom
tobz/host-tags-borrowing-tags-iter

Conversation

@tobz
Copy link
Member

@tobz tobz commented May 8, 2025

Summary

This PR simply updates the Host Tags transform to avoid allocating a backing vector to hold the combined set of tags used when resolving the updated context. Instead, we emulate the approach used by the DogStatsD source which is to simply used a chained iterator: this iterator can be cloned as required by ContextResolver::resolve_with_origin_tags and avoids any intermediate allocations.

This is particularly relevant for the pre-aggregation mode where we're constantly enriching with host tags, as even if the resulting context is cached, we're still allocating a Vec<&str> to hold them all before resolving.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

Unit tests.

References

AGTMETRICS-184

@tobz tobz requested a review from a team as a code owner May 8, 2025 19:12
@tobz tobz added the type/enhancement An enhancement in functionality or support. label May 8, 2025
@github-actions github-actions bot added the area/components Sources, transforms, and destinations. label May 8, 2025
@pr-commenter
Copy link

pr-commenter bot commented May 8, 2025

Regression Detector (DogStatsD)

Regression Detector Results

Run ID: cb9d8126-c081-441f-a976-adfda1f02b3a

Baseline: 7.65.0-rc.9
Comparison: 7.65.0-rc.9

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_500mb_3k_contexts ingress throughput +1.08 [+0.99, +1.18] 1
quality_gates_idle_rss memory utilization +0.56 [+0.44, +0.67] 1
dsd_uds_100mb_3k_contexts_distributions_only memory utilization +0.18 [-0.03, +0.39] 1
dsd_uds_100mb_3k_contexts ingress throughput +0.00 [-0.11, +0.11] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_512kb_3k_contexts ingress throughput +0.00 [-0.01, +0.01] 1
dsd_uds_40mb_12k_contexts_40_senders ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts_memlimit ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_100mb_250k_contexts ingress throughput -0.01 [-0.14, +0.12] 1
dsd_uds_10mb_3k_contexts ingress throughput -0.01 [-0.07, +0.05] 1

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 0/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@pr-commenter
Copy link

pr-commenter bot commented May 8, 2025

Regression Detector (Checks Agent Go)

Regression Detector Results

Run ID: 8f487c6c-3078-4e3e-9403-7ad11bdaa71f

Baseline: f61d1f4e054b884cb1894254ab2714b84b4684cb
Comparison: f61d1f4e054b884cb1894254ab2714b84b4684cb
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gates_idle_rss memory utilization +0.51 [+0.46, +0.56] 1

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@pr-commenter
Copy link

pr-commenter bot commented May 8, 2025

Regression Detector (Checks Agent)

Regression Detector Results

Run ID: f03c3d7b-e1c3-4e97-89a4-00f94cd1dbe2

Baseline: f52d3dd
Comparison: f8482f6
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gates_idle_rss memory utilization -0.30 [-0.31, -0.29] 1

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 10/10

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@tobz tobz merged commit 7ee652b into main May 8, 2025
41 of 42 checks passed
@tobz tobz deleted the tobz/host-tags-borrowing-tags-iter branch May 8, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. type/enhancement An enhancement in functionality or support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants