Skip to content

feat(trace-utils): add span pool for recycling span allocations - #2477

Open
paullegranddc wants to merge 1 commit into
mainfrom
paullgdc/trace-utils/span_pool_types
Open

feat(trace-utils): add span pool for recycling span allocations#2477
paullegranddc wants to merge 1 commit into
mainfrom
paullgdc/trace-utils/span_pool_types

Conversation

@paullegranddc

@paullegranddc paullegranddc commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Allocation is expensive, and spans use a lot of small collections (meta, metrics, span links, events...). Being able to recycle the allocation should be beneficial in term of perf.

This PR adds the pool types only. A stacked follow-up PR (#2382) switches the data-pipeline send path over to them.

Changes

  • Add SpanPool<T> in libdd-trace-utils/src/span/span_pool.rs
    • Backed by a bounded crossbeam channel so the pool never grows without limit.
    • A thread-local chunk cache keeps the single-producer (exporter) path lock-free and gives each thread a local chunk under contention.
  • Add PooledChunks<'_, T>, which wraps Vec<Vec<Span<T>>> and returns its spans to a SpanPool on drop. PooledChunks::unpooled() is a zero-overhead wrapper for callers that do not use the pool.
  • Add MaybePool so call sites can feed spans/chunks back to the pool only when one is attached, and otherwise drop them.
  • Add Send bounds to SpanText/SpanBytes so pooled Vec<Span<T>> can flow through the crossbeam channel and thread-local cache.
  • Add criterion benchmarks for the pool (recycle vs. allocate) under libdd-trace-utils/benches/span_pool.rs.

Performance

This makes the alloc/populate/dealloc cycle about 20% to 30% faster

Name Allocation (ns) Pooled (ns) Increase
small chunk (1x10) 842.73 616.29 x1.36
big chunks (20x100) 171560 144270 x1.18

Additional Notes

Pure addition, no behavior change. The new types are not used anywhere yet. The stacked PR #2382 wires them into the trace exporter.

# Motivation

Allocation is expensive, and spans use a lot of small collections (meta,
metrics, span links, events...). Being able to recycle the allocations
should be beneficial in terms of perf.

# Changes

* Add `SpanPool<T>` in `libdd-trace-utils/src/span/span_pool.rs`, backed
  by a bounded crossbeam channel so the pool never grows without limit.
  A thread-local chunk cache keeps the single-producer (exporter) path
  lock-free and gives each thread a local chunk under contention.
* Add `PooledChunks<'_, T>`, which wraps `Vec<Vec<Span<T>>>` and returns
  its spans to a `SpanPool` on drop. `PooledChunks::unpooled()` is a
  zero-overhead wrapper for callers that do not use the pool.
* Add `MaybePool` so call sites can feed spans/chunks back to the pool
  only when one is attached, and otherwise drop them.
* Add `Send` bounds to `SpanText`/`SpanBytes` so pooled `Vec<Span<T>>`
  can flow through the crossbeam channel and thread-local cache.
* Add criterion benchmarks for the pool (recycle vs. allocate) under
  `libdd-trace-utils/benches/span_pool.rs`.

Nothing is wired into the live pipeline yet, so there is no behavior
change. The follow-up stacked PR switches the data-pipeline send path
over to these types.

# Additional Notes

Pure addition, no behavior change — the new types are not used anywhere
yet, so there is no regression risk.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T18:40:05.312901Z 34891d4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation Check Results

⚠️ 771 documentation warning(s) found

📦 libdd-trace-utils - 771 warning(s)


Updated: 2026-09-07 18:30:41 UTC | Commit: 5e514f4 | missing-docs job results

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🔒 Cargo Deny Results

⚠️ 3 issue(s) found, showing only errors (advisories, bans, sources)

📦 libdd-trace-utils - 3 error(s)

Show output
error[vulnerability]: Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:63:1
   │
63 │ crossbeam-epoch 0.9.18 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0204
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0204
   ├ Affected versions of `fmt::Display` dereference the underlying pointer. This causes a invalid pointer dereference e.g., when a pointer created with `Atomic::null` or `Shared::null`. `fmt::Debug` impls and pre-0.9 `fmt::Display` impls, which do not dereference pointers, are not affected by this issue.
   ├ Announcement: https://github.com/crossbeam-rs/crossbeam/pull/1276
   ├ Solution: Upgrade to >=0.9.20 (try `cargo update -p crossbeam-epoch`)
   ├ crossbeam-epoch v0.9.18
     └── crossbeam-deque v0.8.5
         └── rayon-core v1.12.1
             └── rayon v1.10.0
                 └── criterion v0.5.1
                     ├── libdd-common v5.2.0
                     │   ├── libdd-capabilities-impl v4.0.0
                     │   │   └── libdd-trace-utils v11.0.0
                     │   │       └── (dev) libdd-trace-utils v11.0.0 (*)
                     │   └── libdd-trace-utils v11.0.0 (*)
                     ├── (dev) libdd-trace-normalization v4.0.0
                     │   └── libdd-trace-utils v11.0.0 (*)
                     └── (dev) libdd-trace-utils v11.0.0 (*)

error[vulnerability]: h2 unbounded empty DATA frames
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:97:1
   │
97 │ h2 0.4.6 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0258
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0258
   ├ The h2 crate, used internally by hyper, had a flaw that would accept and queue empty DATA frames without limit.
     If streams were not actively drained, this could lead to unbounded memory usage, or a panic if the length overflows.
     
     Low severity.
     
     Patched in v0.4.16.
   ├ Announcement: https://github.com/hyperium/hyper/security/advisories/GHSA-q83h-524g-xf6h
   ├ Solution: Upgrade to >=0.4.16 (try `cargo update -p h2`)
   ├ h2 v0.4.6
     └── hyper v1.6.0
         ├── httpmock v0.8.0-alpha.1
         │   └── libdd-trace-utils v11.0.0
         │       └── (dev) libdd-trace-utils v11.0.0 (*)
         ├── hyper-rustls v0.27.7
         │   └── libdd-common v5.2.0
         │       ├── libdd-capabilities-impl v4.0.0
         │       │   └── libdd-trace-utils v11.0.0 (*)
         │       └── libdd-trace-utils v11.0.0 (*)
         ├── hyper-util v0.1.17
         │   ├── httpmock v0.8.0-alpha.1 (*)
         │   ├── hyper-rustls v0.27.7 (*)
         │   └── libdd-common v5.2.0 (*)
         ├── libdd-common v5.2.0 (*)
         └── libdd-trace-utils v11.0.0 (*)

error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:184:1
    │
184 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
    │
    ├ ID: RUSTSEC-2026-0097
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
    ├ It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
      
      - The `log` and `thread_rng` features are enabled
      - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
      - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
      - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
      - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
      
      `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
    ├ Announcement: https://github.com/rust-random/rand/pull/1763
    ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
    ├ rand v0.8.5
      ├── (dev) libdd-common v5.2.0
      │   ├── libdd-capabilities-impl v4.0.0
      │   │   └── libdd-trace-utils v11.0.0
      │   │       └── (dev) libdd-trace-utils v11.0.0 (*)
      │   └── libdd-trace-utils v11.0.0 (*)
      ├── (dev) libdd-trace-normalization v4.0.0
      │   └── libdd-trace-utils v11.0.0 (*)
      ├── libdd-trace-utils v11.0.0 (*)
      └── proptest v1.5.0
          ├── (dev) libdd-common v5.2.0 (*)
          └── (dev) libdd-tinybytes v1.1.2
              ├── (dev) libdd-tinybytes v1.1.2 (*)
              └── libdd-trace-utils v11.0.0 (*)

advisories FAILED, bans ok, sources ok

Updated: 2026-09-07 18:32:23 UTC | Commit: 5e514f4 | dependency-check job results

@datadog-official

datadog-official Bot commented Sep 7, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

semver-check | validate — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Semantic versioning validation failed. Non-sealed trait added new supertraits in libdd_trace_utils::span::SpanText and SpanBytes, breaking downstream implementations.

Required checks pass | allchecks

View more details · View in GitHub Actions

Some checks have failed or timed out during execution. Please check the workflow run summary for details.

📋 Copy fix prompt
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Before you start, set up the Datadog software-delivery tooling so you can
query the CI data yourself:

1. Check whether you already have the Datadog software-delivery MCP tools
   (e.g. a `search_datadog_ci_pipeline_events` tool) and the `unblock-pr` skill.
2. If either is missing, STOP and ask me for permission before installing
   anything. Do not install or run anything until I have said yes.
3. Only with my explicit approval, set up the Datadog software-delivery MCP
   server and skills by following:
     https://docs.datadoghq.com/getting_started/software_delivery_mcp_tools/
   then restart so the skill is picked up.
4. If I decline, skip all of the above and work from the context below alone.

Then run /unblock-pr — it will pull the CI data itself. The job context below is what we already know.

If /unblock-pr is not available — because I declined the setup above, or it did not install — work from the context below instead.

Datadog has already classified this failure as caused by changes in this PR.
Take that as given and work the fix:

1. Locate the change. Diff this branch against its base and find the change
   that produces this error. Explain the mechanism, don't just name a file:
     git fetch origin && git diff $(git merge-base origin/main HEAD)...HEAD
2. Reproduce it locally. Run the failing job's command or test before
   proposing anything.
3. Propose the smallest fix that addresses the root cause — not a workaround,
   not a broadened assertion, not a disabled or skipped test.
4. Re-run the same command to confirm, and say exactly what you ran.
5. If the failure turns out to be intermittent rather than deterministic, say
   so plainly instead of "fixing" it — that is a flaky test, and patching it
   hides the problem.

If the right move is to re-run the job rather than change code, use the job
link in the context below. For GitHub Actions: `gh run rerun <run-id> --failed`,
where the run ID is the number after `/runs/` in that URL (not the trailing
number, which is the job ID).

Branch: paullgdc/trace-utils/span_pool_types

semver-check | validate
Commit: 5e514f48f5125ccec3c3f0725d22a0225d184d66
Error (code / build):
Semantic versioning validation failed. Non-sealed trait added new supertraits in libdd_trace_utils::span::SpanText and SpanBytes, breaking downstream implementations.
CI job: https://github.com/DataDog/libdatadog/actions/runs/34152585721/job/101838811891

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 80.09%
Overall Coverage: 77.31% (+0.04%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 34891d4 | Docs | View more details | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34891d4de0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +92 to +93
let at = remaining.len() - MAX_CHUNK_SIZE;
Some(remaining.split_off(at))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid retaining the original oversized Vec allocation

When an accepted chunk exceeds MAX_CHUNK_SIZE, split_off leaves the original allocation and its full capacity in remaining, so the final ≤20-span piece still owns the potentially much larger backing buffer. That piece can remain in the queue when traffic drops and may later become a thread's empty_chunk, defeating the split's stated purpose of preventing a thread from hoarding a large chunk; rebuild or shrink the final piece while preserving only the spans' internal allocations.

AGENTS.md reference: AGENTS.md:L76-L76

Useful? React with 👍 / 👎.

Comment on lines +171 to +173
let current = self.inner.len.load(Ordering::Relaxed);
if current + piece_len > self.inner.capacity {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow large chunks to populate small pools

When capacity < MAX_CHUNK_SIZE and a returned chunk has more than 20 spans, the first generated piece contains 20 spans, fails this check, and the return discards both it and every smaller remainder. For example, a capacity-10 pool can never recycle anything from a 21-span chunk even though one span remains after the first split, so callers using a valid small capacity continually allocate; continue examining remainders or size pieces according to the available capacity.

AGENTS.md reference: AGENTS.md:L76-L76

Useful? React with 👍 / 👎.

fn drop_policy() -> bool {
const PCT_OF_SPANS_RETURNED_DROPPED: f64 = 0.1;
thread_local! {
static RNG: RefCell<rand::rngs::SmallRng> = RefCell::new(rand::rngs::SmallRng::from_entropy());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid fallible entropy initialization during cleanup

On a thread whose OS or WASM entropy source is unavailable, SmallRng::from_entropy() panics instead of returning an error. Since PooledChunks::drop reaches this initializer through add_chunks, routine cleanup can unexpectedly panic, and doing so while another panic is already unwinding aborts the host process; this non-cryptographic sampling policy should use an infallible seed or deterministic counter instead.

AGENTS.md reference: AGENTS.md:L72-L72

Useful? React with 👍 / 👎.

Comment on lines +171 to +175
let current = self.inner.len.load(Ordering::Relaxed);
if current + piece_len > self.inner.capacity {
return;
}
self.inner.len.fetch_add(piece_len, Ordering::Relaxed);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make capacity reservation atomic across producers

When two threads return chunks concurrently, both can load the same len, both pass the capacity check, and then both increment it, leaving the unbounded channel above the configured capacity until consumers happen to drain it. With many concurrent PooledChunks drops the excess scales with the number of producers, so the constructors' “at most capacity” guarantee does not hold for this otherwise thread-safe, cloneable pool; reserve space with a compare-and-update operation rather than a separate load and fetch_add.

AGENTS.md reference: AGENTS.md:L76-L76

Useful? React with 👍 / 👎.

Comment on lines +355 to +359
// No drop-policy control here, but a single span is very likely retained.
// If we drop 10% of spans, the likelyhood all spans are dropped is 1/10**100
// which is basically never happening if we ran this test until the heat death of
// this universe
let chunks = pool.wrap_chunks(vec![vec![span("a"); 100]]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the recycling test observe an actually pooled span

drop_policy makes one decision for this entire 100-span input chunk, so the probability that every span is discarded is 10%, not 1/10**100; moreover, whether the chunk is retained or discarded, every subsequent get_span() has the default name and the assertion passes. The test therefore still succeeds if recycling is completely broken, so make the drop policy controllable in tests and assert retained capacity or another property that distinguishes a recycled span from a fresh default.

Useful? React with 👍 / 👎.

@dd-octo-sts

dd-octo-sts Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.45 MB 8.45 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 91.32 MB 91.30 MB --.02% (-22.30 KB) 💪
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.38 MB 11.38 MB --.01% (-1.39 KB) 💪
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 102.61 MB 102.60 MB -0% (-8.08 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.32 MB 27.36 MB +.13% (+37.50 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 96.08 KB 96.08 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.39 MB 185.65 MB +.13% (+264.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 804.08 MB 803.64 MB --.05% (-451.70 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.00 MB 8.99 MB --.08% (-7.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 96.08 KB 96.08 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 26.20 MB 26.21 MB +.02% (+8.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 52.21 MB 52.20 MB --.01% (-9.64 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.82 MB 23.83 MB +.03% (+9.50 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 97.58 KB 97.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 190.44 MB 190.54 MB +.04% (+96.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 787.03 MB 790.84 MB +.48% (+3.80 MB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.96 MB 6.95 MB --.04% (-3.00 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 97.58 KB 97.58 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 28.18 MB 28.20 MB +.08% (+24.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 49.70 MB 49.72 MB +.03% (+19.99 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 81.48 MB 81.45 MB --.03% (-31.32 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.41 MB 9.40 MB --.08% (-8.00 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 97.21 MB 97.21 MB +0% (+1.42 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.46 MB 11.45 MB --.04% (-5.04 KB) 💪

@pr-commenter

pr-commenter Bot commented Sep 7, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-09-07 19:11:21

Comparing candidate commit 34891d4 in PR branch paullgdc/trace-utils/span_pool_types with baseline commit e1bf271 in branch main.

📊 Benchmarking dashboard

Found 18 performance improvements and 8 performance regressions! Performance is the same for 127 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo...

  • 🟩 execution_time [-19.435µs; -19.272µs] or [-9.468%; -9.388%]
  • 🟩 throughput [+504958.929op/s; +509184.671op/s] or [+10.366%; +10.453%]

scenario:normalization/normalize_name/normalize_name/bad-name

  • 🟩 execution_time [-1.067µs; -1.030µs] or [-5.717%; -5.515%]
  • 🟩 throughput [+3131217.335op/s; +3242634.627op/s] or [+5.846%; +6.054%]

scenario:normalization/normalize_name/normalize_name/good

  • 🟩 execution_time [-1.033µs; -0.996µs] or [-9.504%; -9.161%]
  • 🟩 throughput [+9297626.634op/s; +9620346.794op/s] or [+10.106%; +10.457%]

scenario:normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000...

  • 🟩 execution_time [-37.756µs; -37.304µs] or [-7.063%; -6.978%]
  • 🟩 throughput [+140365.902op/s; +142145.873op/s] or [+7.504%; +7.599%]

scenario:normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters

  • 🟩 execution_time [-22.425µs; -22.275µs] or [-11.720%; -11.642%]
  • 🟩 throughput [+689003.195op/s; +693337.911op/s] or [+13.184%; +13.266%]

scenario:normalization/normalize_service/normalize_service/[empty string]

  • 🟥 execution_time [+3.042µs; +3.071µs] or [+8.518%; +8.600%]
  • 🟥 throughput [-2218393.373op/s; -2196771.620op/s] or [-7.923%; -7.846%]

scenario:otlp/e2e_json/1x1000

  • 🟥 execution_time [+364.577µs; +367.809µs] or [+8.736%; +8.814%]

scenario:otlp/encode_json/1x1000

  • 🟥 execution_time [+373.224µs; +374.283µs] or [+20.400%; +20.458%]

scenario:vec_map/as_deduped_map/already_deduped/8

  • 🟩 execution_time [-0.864ns; -0.849ns] or [-5.508%; -5.413%]

scenario:vec_map/get_hit/16

  • 🟥 execution_time [+32.223ns; +34.482ns] or [+15.914%; +17.029%]
  • 🟥 throughput [-11606253.139op/s; -10933791.844op/s] or [-14.670%; -13.820%]

scenario:vec_map/get_hit/8

  • 🟥 execution_time [+10.898ns; +10.934ns] or [+20.218%; +20.286%]
  • 🟥 throughput [-25036513.245op/s; -24955040.112op/s] or [-16.869%; -16.814%]

scenario:vec_map/get_miss/8

  • 🟩 execution_time [-1.844ns; -1.804ns] or [-24.570%; -24.039%]

scenario:vec_map/iter/128

  • 🟩 execution_time [-7.615ns; -7.509ns] or [-6.780%; -6.685%]
  • 🟩 throughput [+81699686.154op/s; +82799104.122op/s] or [+7.169%; +7.266%]

scenario:vec_map/iter/16

  • 🟩 execution_time [-0.597ns; -0.585ns] or [-4.366%; -4.277%]
  • 🟩 throughput [+52318344.206op/s; +53439083.688op/s] or [+4.470%; +4.565%]

scenario:vec_map/iter/8

  • 🟩 execution_time [-0.592ns; -0.586ns] or [-8.186%; -8.096%]
  • 🟩 throughput [+97403106.234op/s; +98568680.180op/s] or [+8.811%; +8.916%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant