Repository navigation
bench: criterion benches for the DogStatsD hot path and the agent config load - #198
Open
duncanista wants to merge 2 commits into
Open
duncanista wants to merge 2 commits into
duncanista wants to merge 2 commits into
Conversation
…he agent config load
duncanista
requested review from
apiarian-datadog and
shreyamalpani
and removed request for
a team
October 28, 2026 19:01
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… --all-targets on windows
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Jira: SVLS-9977
crates/dogstatsd/benches/hotpath.rs: criterion benches for the DogStatsD hot path, in thegroups
dogstatsd/{parse,packet,insert,flush,compress,ustr}: metric parse, a20-line packet, context insert and sketch merge, the series and sketch flush copies and
encodes, zstd stream against bulk compression, and the
ustrinterner first use and growth.
crates/datadog-agent-config/benches/load.rs:config/{get_config,get_config_yaml,replace_rules}with the none, typical and heavy environment sets of a Lambda sandbox, a
datadog.yaml, andthe replace-rule compile.
criterion0.5 as a dev-dependency of both crates, withdefault-features = false(noplotters, no rayon, so the benches run on one thread; the
set_varcalls rely on that).[lib] bench = false, socargo benchruns only criterion. The lock andLICENSE-3rdparty.csvadd criterion's crates..github/workflows/cargo.yml: clippy runs with--all-targets, so the benches stay compiling.Motivation
The extension runs at about 0.07 vCPU at 128 MB, so per-metric and per-flush costs show up in
billed duration. Each performance fix in these crates should come with a before and after
number from a bench. The bottlecap side of the suite is in datadog-lambda-extension
(
bottlecap/benches/), which links to these groups.Additional Notes
The benches use the system allocator, not jemalloc as the extension does, so compare ratios
(fix against main), not absolute times with bottlecap's numbers. The workspace release profile
(
opt-level = "z", LTO) applies tocargo bench; for a quick local run useCARGO_PROFILE_BENCH_LTO=false CARGO_PROFILE_BENCH_CODEGEN_UNITS=16.Describe how to test/QA your changes
On a copy of
mainat b6aa5fa with this change:cargo fmt --all -- --check: pass.cargo clippy --locked -p dogstatsd -p datadog-agent-config --all-features --all-targets -- -D warnings: pass.CARGO_PROFILE_BENCH_LTO=false CARGO_PROFILE_BENCH_CODEGEN_UNITS=16 cargo bench --no-run --locked -p dogstatsd -p datadog-agent-config: pass (2 bench executables).cargo clippy --workspace --all-targetsand the license check.Patch:
sc-bench.patchin this folder (a copy of the bench branch diff against b6aa5fa).