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

chore(core): Wrap event metadata in Arc for performance #21188

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

bruceg
Copy link
Member

@bruceg bruceg commented Aug 30, 2024

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.

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.
@bruceg bruceg added type: tech debt A code change that does not add user value. domain: performance Anything related to Vector's performance domain: data model Anything related to Vector's internal data model domain: core Anything related to core crates i.e. vector-core, core-common, etc labels Aug 30, 2024
@bruceg bruceg added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Aug 30, 2024
@bruceg
Copy link
Member Author

bruceg commented Aug 30, 2024

/ci-run-regression

@datadog-vectordotdev
Copy link

datadog-vectordotdev bot commented Aug 30, 2024

Datadog Report

Branch report: bruceg/arc-event-metadata
Commit report: 8c540ec
Test service: vector

✅ 0 Failed, 7 Passed, 0 Skipped, 25.46s Total Time

@pront
Copy link
Contributor

pront commented Sep 3, 2024

Very interesting PR!

/ci-run-regression

Did the above produce a report?

Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

/ci-run-regression

@bruceg bruceg marked this pull request as ready for review September 3, 2024 16:22
@bruceg bruceg requested a review from a team as a code owner September 3, 2024 16:22
@bruceg
Copy link
Member Author

bruceg commented Sep 3, 2024

/ci-run-regression

@bruceg
Copy link
Member Author

bruceg commented Sep 3, 2024

Did the above produce a report?

No. I'm wondering if it won't run on draft PRs, so I dropped the draft flag.

Copy link

github-actions bot commented Sep 3, 2024

Regression Detector Results

Run ID: 61034cca-2b3b-452a-87b7-b0b45b052989 Metrics dashboard

Baseline: 06ad674
Comparison: 32c4fd8

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

Significant changes in experiment optimization goals

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

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]

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

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:

  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".

@jszwedko
Copy link
Member

jszwedko commented Sep 3, 2024

Did the above produce a report?

No. I'm wondering if it won't run on draft PRs, so I dropped the draft flag.

The trigger actually requires the comment to be left as a review now rather than simply a comment.

@bruceg
Copy link
Member Author

bruceg commented Sep 3, 2024

Given that the entire inner metadata is now in an Arc, would it make sense to unwrap any of the inner Arc fields? Most likely not for the schema_definition, but what about the others?

@lukesteensen
Copy link
Member

would it make sense to unwrap any of the inner Arc fields?

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.

@bruceg bruceg requested review from a team as code owners October 21, 2024 22:16
@github-actions github-actions bot added domain: releasing Anything related to releasing Vector domain: external docs Anything related to Vector's external, public documentation labels Oct 21, 2024
Copy link
Contributor

@pront pront left a 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 🚀

@github-actions github-actions bot removed domain: releasing Anything related to releasing Vector domain: external docs Anything related to Vector's external, public documentation labels Oct 22, 2024
bruceg

This comment was marked as duplicate.

@bruceg bruceg added this pull request to the merge queue Oct 22, 2024
Copy link

Regression Detector Results

Run ID: 8136f083-e23f-42de-aac8-09a138110872 Metrics dashboard

Baseline: 5d517b9
Comparison: 86c313f

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

Significant changes in experiment optimization goals

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

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]

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

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:

  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".

Merged via the queue into master with commit 86c313f Oct 22, 2024
66 of 67 checks passed
@bruceg bruceg deleted the bruceg/arc-event-metadata branch October 22, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: data model Anything related to Vector's internal data model domain: performance Anything related to Vector's performance no-changelog Changes in this PR do not need user-facing explanations in the release changelog type: tech debt A code change that does not add user value.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants