-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow mutating of tags on contexts. #121
Conversation
Regression Detector (DogStatsD)Regression Detector ResultsRun ID: d5d12a44-8643-446a-8e12-b5b23af98d04 Baseline: 7.52.0 Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
➖ | dsd_uds_1mb_3k_contexts | ingress throughput | +0.07 | [+0.00, +0.13] | |
➖ | dsd_uds_100mb_3k_contexts | ingress throughput | +0.00 | [-0.01, +0.02] | |
➖ | dsd_uds_500mb_3k_contexts | ingress throughput | +0.00 | [+0.00, +0.01] | |
➖ | dsd_uds_100mb_250k_contexts | ingress throughput | -0.00 | [-0.05, +0.04] | |
➖ | dsd_uds_1mb_50k_contexts_memlimit | ingress throughput | -0.02 | [-0.06, +0.02] | |
➖ | dsd_uds_512kb_3k_contexts | ingress throughput | -0.02 | [-0.07, +0.04] | |
➖ | dsd_uds_10mb_3k_contexts | ingress throughput | -0.03 | [-0.07, +0.00] | |
➖ | dsd_uds_1mb_50k_contexts | ingress throughput | -0.03 | [-0.09, +0.02] | |
➖ | dsd_uds_100mb_3k_contexts_distributions_only | memory utilization | -1.75 | [-1.97, -1.54] |
Explanation
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".
Regression Detector (Saluki)Regression Detector ResultsRun ID: d281d9cc-6c7e-4ae5-a656-65ff90bc5313 Baseline: 57d2912 Performance changes are noted in the perf column of each table:
No significant changes in experiment optimization goalsConfidence level: 90.00% There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
➖ | dsd_uds_100mb_3k_contexts_distributions_only | memory utilization | +1.32 | [+1.20, +1.44] | |
➖ | dsd_uds_500mb_3k_contexts | ingress throughput | +0.96 | [+0.82, +1.11] | |
➖ | dsd_uds_1mb_50k_contexts_memlimit | ingress throughput | +0.64 | [-2.51, +3.80] | |
➖ | dsd_uds_10mb_3k_contexts | ingress throughput | +0.08 | [+0.01, +0.15] | |
➖ | dsd_uds_512kb_3k_contexts | ingress throughput | +0.01 | [-0.05, +0.07] | |
➖ | dsd_uds_100mb_3k_contexts | ingress throughput | +0.00 | [-0.01, +0.02] | |
➖ | dsd_uds_50mb_10k_contexts_no_inlining_no_allocs | ingress throughput | +0.00 | [-0.05, +0.05] | |
➖ | dsd_uds_50mb_10k_contexts_no_inlining | ingress throughput | -0.00 | [-0.00, +0.00] | |
➖ | dsd_uds_1mb_50k_contexts | ingress throughput | -0.00 | [-0.02, +0.02] | |
➖ | dsd_uds_1mb_3k_contexts | ingress throughput | -0.01 | [-0.06, +0.04] | |
➖ | dsd_uds_100mb_250k_contexts | ingress throughput | -0.29 | [-0.49, -0.08] |
Explanation
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".
Context
Currently, contexts are effectively immutable because we initially wanted to focus on making them able to be cached and "resolvable" (looked up with a borrowed version of the name/tags) without needing any allocations. Doing so involves caching their hashed value, which meant avoiding mutating the name/tags to avoid messing with the hash value and breaking how they were stored (which is in a hashset).
Solution
This PR adds back the ability to mutate tags. When acquiring a mutable reference to the tags on a context, we do a clone-on-write approach with the inner state, which clones it if there's another reference to the inner state. As such, this creates a new context which can then be modified as much as possible without further cloning, since it's now owned independently of the original context.
Additionally, we've also tweaked the handling of the context's hash value to mark a context as "dirty" when we do anything mutable with the tags, which causes its
Hash
implementation to flip back to hashing on demand instead of using the cached value.This is a little suboptimal for a few reasons:
Vec<Tag>
)I think this is acceptable for the moment, because:
Vec<Tag>
is a lot better than allocatingVec<Tag>
and N tags