-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore(core): Wrap event metadata in Arc
for performance
#21188
Conversation
The `EventMetadata` structure contains a number of sub-structures that can cause extensive deep copies when an event is cloned, most notably `value: vrl::value::Value`. To improve this, wrap the actual inner event metadata in an `Arc`, and use the standard tools from that type to only clone it when needed to provide a mutable or owned copy.
/ci-run-regression |
Datadog ReportBranch report: ✅ 0 Failed, 7 Passed, 0 Skipped, 25.46s Total Time |
Very interesting PR!
Did the above produce a report? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ci-run-regression
/ci-run-regression |
No. I'm wondering if it won't run on draft PRs, so I dropped the draft flag. |
Regression Detector ResultsRun ID: 61034cca-2b3b-452a-87b7-b0b45b052989 Metrics dashboard Baseline: 06ad674 Performance changes are noted in the perf column of each table:
Significant changes in experiment optimization goalsConfidence level: 90.00%
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
➖ | file_to_blackhole | egress throughput | -2.81 | [-9.49, +3.88] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
✅ | http_text_to_http_json | ingress throughput | +12.70 | [+12.56, +12.84] | |
✅ | syslog_log2metric_humio_metrics | ingress throughput | +11.19 | [+11.07, +11.31] | |
✅ | http_to_http_acks | ingress throughput | +7.22 | [+6.06, +8.37] | |
➖ | fluent_elasticsearch | ingress throughput | +2.10 | [+1.60, +2.60] | |
➖ | socket_to_socket_blackhole | ingress throughput | +1.98 | [+1.92, +2.04] | |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | +1.68 | [+1.49, +1.88] | |
➖ | otlp_http_to_blackhole | ingress throughput | +1.67 | [+1.56, +1.79] | |
➖ | otlp_grpc_to_blackhole | ingress throughput | +1.66 | [+1.55, +1.77] | |
➖ | http_to_s3 | ingress throughput | +1.26 | [+0.99, +1.53] | |
➖ | splunk_hec_route_s3 | ingress throughput | +1.12 | [+0.78, +1.46] | |
➖ | syslog_loki | ingress throughput | +1.11 | [+1.04, +1.18] | |
➖ | datadog_agent_remap_blackhole | ingress throughput | +1.07 | [+0.96, +1.17] | |
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | +0.67 | [+0.60, +0.75] | |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | +0.47 | [+0.24, +0.70] | |
➖ | syslog_humio_logs | ingress throughput | +0.46 | [+0.31, +0.61] | |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | +0.28 | [+0.15, +0.42] | |
➖ | http_to_http_noack | ingress throughput | +0.15 | [+0.07, +0.23] | |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | +0.08 | [-0.02, +0.19] | |
➖ | http_to_http_json | ingress throughput | +0.06 | [+0.01, +0.11] | |
➖ | http_elasticsearch | ingress throughput | +0.02 | [-0.18, +0.22] | |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | +0.01 | [-0.08, +0.10] | |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | +0.01 | [-0.09, +0.10] | |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | +0.01 | [-0.07, +0.09] | |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | -1.15 | [-1.28, -1.02] | |
➖ | syslog_splunk_hec_logs | ingress throughput | -2.28 | [-2.40, -2.15] | |
➖ | file_to_blackhole | egress throughput | -2.81 | [-9.49, +3.88] |
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".
The trigger actually requires the comment to be left as a review now rather than simply a comment. |
Given that the entire inner metadata is now in an |
I'm skeptical that unwrapping these would make much of a difference. There may still be some slight benefit to keeping them wrapped if they are more static than other metadata fields. |
Co-authored-by: Bryce Eadie <[email protected]> Signed-off-by: Jesse Szwedko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a rebase (or merge) on the latest origin/master. Otherwise, it is good to go 🚀
Regression Detector ResultsRun ID: 8136f083-e23f-42de-aac8-09a138110872 Metrics dashboard Baseline: 5d517b9 Performance changes are noted in the perf column of each table:
Significant changes in experiment optimization goalsConfidence level: 90.00%
|
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
➖ | file_to_blackhole | egress throughput | -2.21 | [-6.26, +1.84] |
Fine details of change detection per experiment
perf | experiment | goal | Δ mean % | Δ mean % CI | links |
---|---|---|---|---|---|
✅ | http_text_to_http_json | ingress throughput | +13.70 | [+13.53, +13.86] | |
✅ | socket_to_socket_blackhole | ingress throughput | +6.23 | [+6.17, +6.29] | |
➖ | datadog_agent_remap_datadog_logs | ingress throughput | +3.81 | [+3.64, +3.98] | |
➖ | otlp_http_to_blackhole | ingress throughput | +2.71 | [+2.62, +2.80] | |
➖ | syslog_log2metric_humio_metrics | ingress throughput | +2.61 | [+2.49, +2.74] | |
➖ | http_elasticsearch | ingress throughput | +2.58 | [+2.39, +2.76] | |
➖ | syslog_log2metric_splunk_hec_metrics | ingress throughput | +1.23 | [+1.10, +1.36] | |
➖ | syslog_loki | ingress throughput | +1.03 | [+0.94, +1.11] | |
➖ | syslog_humio_logs | ingress throughput | +0.80 | [+0.64, +0.95] | |
➖ | datadog_agent_remap_blackhole | ingress throughput | +0.40 | [+0.33, +0.48] | |
➖ | datadog_agent_remap_datadog_logs_acks | ingress throughput | +0.23 | [+0.10, +0.36] | |
➖ | syslog_log2metric_tag_cardinality_limit_blackhole | ingress throughput | +0.16 | [+0.05, +0.26] | |
➖ | splunk_hec_to_splunk_hec_logs_noack | ingress throughput | +0.00 | [-0.02, +0.02] | |
➖ | splunk_hec_indexer_ack_blackhole | ingress throughput | -0.00 | [-0.02, +0.02] | |
➖ | http_to_http_noack | ingress throughput | -0.00 | [-0.06, +0.06] | |
➖ | splunk_hec_to_splunk_hec_logs_acks | ingress throughput | -0.00 | [-0.03, +0.02] | |
➖ | http_to_http_json | ingress throughput | -0.01 | [-0.05, +0.04] | |
➖ | http_to_s3 | ingress throughput | -0.10 | [-0.26, +0.06] | |
➖ | datadog_agent_remap_blackhole_acks | ingress throughput | -0.14 | [-0.25, -0.02] | |
➖ | http_to_http_acks | ingress throughput | -0.75 | [-1.21, -0.28] | |
➖ | otlp_grpc_to_blackhole | ingress throughput | -1.23 | [-1.42, -1.05] | |
➖ | syslog_splunk_hec_logs | ingress throughput | -1.88 | [-1.99, -1.76] | |
➖ | file_to_blackhole | egress throughput | -2.21 | [-6.26, +1.84] | |
➖ | splunk_hec_route_s3 | ingress throughput | -2.64 | [-2.95, -2.33] | |
➖ | syslog_regex_logs2metric_ddmetrics | ingress throughput | -3.04 | [-3.15, -2.92] | |
➖ | fluent_elasticsearch | ingress throughput | -3.35 | [-3.89, -2.80] |
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".
The
EventMetadata
structure contains a number of sub-structures that can cause extensive deep copies when an event is cloned, most notablyvalue: vrl::value::Value
. To improve this, wrap the actual inner event metadata in anArc
, and use the standard tools from that type to only clone it when needed to provide a mutable or owned copy.