Add perf-review skill for pre-PR hot-path performance review#11912
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 81ce335 | Docs | Datadog PR Page | Give us feedback! |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Adds a read-only `/perf-review` Claude Code skill under .claude/skills/perf-review/ that reviews a diff / branch / PR for tracer performance overhead using the perf rubric: 7 universal checks + the Java addendum (J1-J11) + ByteBuddy-Advice fix idioms, with a precision-first, advisory, verify-don't-verdict posture (do-no-harm / assume-hot). - SKILL.md: posture, workflow, PR-style output template, and a compact check index (pointers into the references). - references/guide.md: the narrative "how" (severity, hotness, categories). - references/checks.md: the confidence/severity cost-model + Java addendum. - references/example-review.md: a worked review to calibrate output. Also adds a "Review Guidelines" section to AGENTS.md that points at the skill for the pre-PR performance review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
050d46d to
218da4a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 218da4a51f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
More details
This PR adds a read-only performance-review skill and documentation for pre-PR hot-path analysis. No tracer code changes. All cited utilities (HashingUtils, Strings, Hashtable, RE2J) are verified to exist; "coming" items are properly marked. One documentation inconsistency: example-review.md embeds reachability information as prose rather than the structured bullet-point format the template requires, which could confuse reviewers on output format consistency.
🤖 Datadog Autotest · Commit 218da4a · What is Autotest? · Any feedback? Reach out in #autotest
bm1549
left a comment
There was a problem hiding this comment.
Overall, this is a solid use of the progressive disclosure pattern and the AGENTS.md pointer to the skill file will likely get the Codex PR reviewer's attention, although it's not fully deterministic. A future iteration can use something like datadog-agent's agentic code review workflow, but that can be a follow-up task
Mostly left comments on the way the skill is structured, rather than the contents of the skill itself. Once these comments are resolved (and Codex's ones are either solved or dismissed), I think this is good to merge
PerfectSlayer
left a comment
There was a problem hiding this comment.
I’ll check what we can trim from agent.md to keep it as small as possible, and maybe offload to, or deduplicate rules with the skill description instead
Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
Co-authored-by: Brian Marks <bm1549@users.noreply.github.com>
- guide: cache fix cites DDCaches (factory), not DDCache (interface) - guide: Java-8-safe HashMap pre-size (no JDK-19 newHashMap default) - checks J9: scope to varargs/boxing; carve out allocation-free 31-based combines - checks: scope @Advice.Origin flag to reflective Method/Constructor (String origins are constants) - AGENTS: point skill link at .claude/skills (matches the other skills) - gitignore the local rubric-maintenance file; narrow the auto-invoke trigger Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the "it never blocks a merge" meta-phrasing from the skill description and body — "not a gate" / "advisory" already convey it, and the agent doesn't need to be told it isn't a merge gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Adds a read-only
/perf-reviewClaude Code skill (.claude/skills/perf-review/) that reviews a diff / branch / PR for tracer performance overhead using the performance rubric, and notes the pre-PR performance review underAGENTS.md's PR conventions (alongside/techdebt).The skill flags hot-path allocation, unbounded memory, repeated work, escaping objects, native-boundary crossings, and JVM-specific pitfalls (escape analysis, JNI / virtual-thread pinning, backtracking-regex ReDoS, varargs/boxing hashing,
String.format, ByteBuddy-Advice anti-patterns).Posture: do-no-harm / assume-hot, advisory (never blocks a merge), precision over recall (silent when unsure), and verify-don't-verdict (every finding routes to Benchmark → Profile → Improve → Guard). It is read-only — it reports ranked findings and never edits code.
Motivation
Catch any big structural issues - unbounded collections, etc before merge & release
Accumulate small performance wins - to improve the performance of the whole
Additional Notes
Layout
SKILL.md— posture, workflow, a PR-style output template, and a compact check index.references/guide.md— the narrative "how": severity model, hotness rubric, categories with examples.references/checks.md— the confidence/severity cost-model: 7 universal checks + Java addendum (J1–J11) + ByteBuddy-Advice fix idioms.references/example-review.md— a worked review to calibrate output.Usage
Run
/perf-reviewbefore opening a PR. It computes the branch diff against the upstream merge-base (or reviews specific files you point it at) and reports findings with confidence, severity, the reachability path, and a verify-with suggestion.Validation
Back-tested against a curated perf-review corpus of merged/closed PRs with known expected verdicts — reproduced the expected precision (false-positive traps stay silent), recall (real regressions flagged), and nuance (severity-regime demotion, resolve-via-sink, correctness-lens routing).
Notes
AGENTS.mdline.tag: no release notes.🤖 Generated with Claude Code