experiment(context): amortized/deferred mutable view over tag set filtering (#1293 cherry pick)#1295
experiment(context): amortized/deferred mutable view over tag set filtering (#1293 cherry pick)#1295
Conversation
3c90a52 to
f7bbb1a
Compare
There was a problem hiding this comment.
Pull request overview
This is a cherry-pick of PR #1292 that implements a lazy copy-on-write mutable view pattern for tag set filtering operations. The feature defers expensive operations like Arc clones and context key recomputation until mutations are actually recorded, potentially improving performance when filtering metrics.
Changes:
- Add
collect_removalsandapply_removalsmethods toTagSetto support deferred mutation - Create
TagSetMutViewandTagSetMutViewStateto implement lazy copy-on-write semantics - Refactor
tag_filterlistcomponent to use the new mutable view API and store reusable state - Update all tests to pass the new required parameter
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/saluki-context/src/tags/tagset/owned.rs | Adds two new methods for collecting and applying tag removal indices in a deferred manner |
| lib/saluki-context/src/lib.rs | Exports new public types TagSetMutView and TagSetMutViewState |
| lib/saluki-context/src/context.rs | Implements TagSetMutViewState for scratch space and TagSetMutView for lazy copy-on-write tag mutations |
| bin/agent-data-plane/src/components/tag_filterlist/mod.rs | Refactors filtering logic to use the new mutable view pattern, removing the has_removable_tags function and updating all test calls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0e89ca2 to
1bfb364
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1bfb364 to
b8b7477
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b8b7477 to
3bd63f3
Compare
3bd63f3 to
7a3fd5e
Compare
Binary Size Analysis (Agent Data Plane)Target: 3e775e7 (baseline) vs 6866597 (comparison) diff
|
| Module | File Size | Symbols |
|---|---|---|
agent_data_plane::components::tag_filterlist |
-8.41 KiB | 5 |
core |
+3.78 KiB | 68 |
saluki_context::tags::tagset |
+1.36 KiB | 5 |
[Unmapped] |
+1.32 KiB | 1 |
smallvec |
-960 B | 1 |
hashbrown |
-650 B | 7 |
saluki_context::tags::Tag |
-420 B | 1 |
saluki_context::context::TagSetMutView |
+311 B | 1 |
alloc |
+207 B | 107 |
[sections] |
-189 B | 6 |
idna |
-77 B | 1 |
axum |
-66 B | 1 |
unicode_segmentation |
+8 B | 1 |
ddsketch::agent::sketch |
+5 B | 1 |
std |
-4 B | 25 |
serde_yaml |
+2 B | 5 |
protobuf |
-1 B | 2 |
agent_data_plane::cli::run |
+1 B | 1 |
saluki_core::data_model::event |
+0 B | 2 |
hickory_proto |
+0 B | 18 |
Detailed Symbol Changes
FILE SIZE VM SIZE
-------------- --------------
[NEW] +27.2Ki [NEW] +27.0Ki _<agent_data_plane::components::tag_filterlist::TagFilterlist as saluki_core::components::transforms::Transform>::run::_{{closure}}::h743d6c09bd780764
[NEW] +10.6Ki [NEW] +10.5Ki <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9926
[NEW] +5.52Ki [NEW] +5.38Ki <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8377
[NEW] +5.13Ki [NEW] +5.00Ki <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11165
+0.3% +4.71Ki +0.3% +3.14Ki [469 Others]
[NEW] +4.71Ki [NEW] +4.59Ki <rustls::error::Error as core::clone::Clone>::clone.9904
[NEW] +4.71Ki [NEW] +4.59Ki <rustls::error::Error as core::clone::Clone>::clone.11180
[NEW] +3.83Ki [NEW] +3.71Ki <webpki::error::Error as core::fmt::Debug>::fmt.11358
[NEW] +3.66Ki [NEW] +3.54Ki <rustls::error::Error as core::fmt::Debug>::fmt.9533
[NEW] +3.57Ki [NEW] +3.45Ki <rustls::error::Error as core::fmt::Debug>::fmt.11181
[NEW] +2.81Ki [NEW] +2.69Ki <figment::error::Error as core::clone::Clone>::clone.7763
[DEL] -2.81Ki [DEL] -2.69Ki <figment::error::Error as core::clone::Clone>::clone.7801
[DEL] -3.57Ki [DEL] -3.45Ki <rustls::error::Error as core::fmt::Debug>::fmt.11217
[DEL] -3.66Ki [DEL] -3.54Ki <rustls::error::Error as core::fmt::Debug>::fmt.9571
[DEL] -3.83Ki [DEL] -3.71Ki <webpki::error::Error as core::fmt::Debug>::fmt.11394
[DEL] -4.71Ki [DEL] -4.59Ki <rustls::error::Error as core::clone::Clone>::clone.11216
[DEL] -4.71Ki [DEL] -4.59Ki <rustls::error::Error as core::clone::Clone>::clone.9946
[DEL] -5.13Ki [DEL] -5.00Ki <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.11201
[DEL] -5.52Ki [DEL] -5.38Ki <hickory_proto::rr::record_data::RData as core::clone::Clone>::clone.8415
[DEL] -10.6Ki [DEL] -10.5Ki <saluki_core::data_model::event::Event as core::clone::Clone>::clone.9968
[DEL] -35.7Ki [DEL] -35.5Ki _<agent_data_plane::components::tag_filterlist::TagFilterlist as saluki_core::components::transforms::Transform>::run::_{{closure}}::h468c85120b3a918a
-0.0% -3.74Ki -0.0% -5.32Ki TOTAL
Regression Detector (Agent Data Plane)Regression Detector ResultsRun ID: e251b62d-4bd3-4124-843f-fd8a0d3f7fb1 Baseline: 3e775e7 Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | otlp_ingest_logs_5mb_memory | memory utilization | +4.03 | [+3.62, +4.44] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_logs_5mb_cpu | % cpu utilization | +1.56 | [-3.07, +6.19] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_logs_5mb_throughput | ingress throughput | -0.01 | [-0.13, +0.11] | 1 | (metrics) (profiles) (logs) |
Fine details of change detection per experiment
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | dsd_uds_512kb_3k_contexts_cpu | % cpu utilization | +7.40 | [-52.51, +67.31] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_logs_5mb_memory | memory utilization | +4.03 | [+3.62, +4.44] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_filtering_5mb_cpu | % cpu utilization | +2.07 | [-0.55, +4.69] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_logs_5mb_cpu | % cpu utilization | +1.56 | [-3.07, +6.19] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_transform_5mb_cpu | % cpu utilization | +0.48 | [-1.66, +2.62] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_metrics_5mb_memory | memory utilization | +0.43 | [+0.23, +0.64] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_5mb_memory | memory utilization | +0.29 | [+0.05, +0.54] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_500mb_3k_contexts_cpu | % cpu utilization | +0.29 | [-1.06, +1.65] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_512kb_3k_contexts_memory | memory utilization | +0.24 | [+0.07, +0.41] | 1 | (metrics) (profiles) (logs) |
| ➖ | quality_gates_rss_dsd_medium | memory utilization | +0.23 | [+0.04, +0.42] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_filtering_5mb_memory | memory utilization | +0.19 | [-0.14, +0.51] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_500mb_3k_contexts_memory | memory utilization | +0.15 | [-0.02, +0.32] | 1 | (metrics) (profiles) (logs) |
| ➖ | quality_gates_rss_dsd_low | memory utilization | +0.11 | [-0.08, +0.30] | 1 | (metrics) (profiles) (logs) |
| ➖ | quality_gates_rss_dsd_ultraheavy | memory utilization | +0.08 | [-0.05, +0.21] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_metrics_5mb_throughput | ingress throughput | +0.05 | [-0.07, +0.18] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_10mb_3k_contexts_memory | memory utilization | +0.03 | [-0.16, +0.21] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_100mb_3k_contexts_throughput | ingress throughput | +0.01 | [-0.02, +0.04] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_10mb_3k_contexts_throughput | ingress throughput | +0.01 | [-0.13, +0.15] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_transform_5mb_throughput | ingress throughput | +0.00 | [-0.02, +0.02] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_1mb_3k_contexts_throughput | ingress throughput | +0.00 | [-0.05, +0.06] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_filtering_5mb_throughput | ingress throughput | -0.00 | [-0.02, +0.02] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_5mb_throughput | ingress throughput | -0.00 | [-0.02, +0.02] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_512kb_3k_contexts_throughput | ingress throughput | -0.00 | [-0.05, +0.05] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_logs_5mb_throughput | ingress throughput | -0.01 | [-0.13, +0.11] | 1 | (metrics) (profiles) (logs) |
| ➖ | quality_gates_rss_dsd_heavy | memory utilization | -0.05 | [-0.19, +0.10] | 1 | (metrics) (profiles) (logs) |
| ➖ | quality_gates_rss_idle | memory utilization | -0.10 | [-0.13, -0.07] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_1mb_3k_contexts_memory | memory utilization | -0.11 | [-0.27, +0.06] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_500mb_3k_contexts_throughput | ingress throughput | -0.50 | [-0.63, -0.36] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_100mb_3k_contexts_memory | memory utilization | -0.52 | [-0.70, -0.35] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_metrics_5mb_cpu | % cpu utilization | -0.58 | [-8.39, +7.23] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_ottl_transform_5mb_memory | memory utilization | -0.68 | [-0.93, -0.44] | 1 | (metrics) (profiles) (logs) |
| ➖ | otlp_ingest_traces_5mb_cpu | % cpu utilization | -0.84 | [-3.07, +1.39] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_10mb_3k_contexts_cpu | % cpu utilization | -1.63 | [-32.73, +29.47] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_100mb_3k_contexts_cpu | % cpu utilization | -3.70 | [-10.01, +2.61] | 1 | (metrics) (profiles) (logs) |
| ➖ | dsd_uds_1mb_3k_contexts_cpu | % cpu utilization | -5.80 | [-57.79, +46.19] | 1 | (metrics) (profiles) (logs) |
Bounds Checks: ✅ Passed
| perf | experiment | bounds_check_name | replicates_passed | observed_value | links |
|---|---|---|---|---|---|
| ✅ | quality_gates_rss_dsd_heavy | memory_usage | 10/10 | 115.57MiB ≤ 140MiB | (metrics) (profiles) (logs) |
| ✅ | quality_gates_rss_dsd_low | memory_usage | 10/10 | 34.20MiB ≤ 50MiB | (metrics) (profiles) (logs) |
| ✅ | quality_gates_rss_dsd_medium | memory_usage | 10/10 | 54.15MiB ≤ 75MiB | (metrics) (profiles) (logs) |
| ✅ | quality_gates_rss_dsd_ultraheavy | memory_usage | 10/10 | 170.70MiB ≤ 200MiB | (metrics) (profiles) (logs) |
| ✅ | quality_gates_rss_idle | memory_usage | 10/10 | 21.45MiB ≤ 40MiB | (metrics) (profiles) (logs) |
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".

Summary
Cherry-pick of #1292 on top of #1296 to test the performance improvements (or, hopefully not: regressions) of the mutable view stuff on top of the
tag_filterlisttransform.Change Type
How did you test this PR?
References