Repository navigation
Reduce DBM comment buffer allocation - #12582
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
Conversation
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
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. |
There was a problem hiding this comment.
More details
The new capacity uses each encoded value and keeps the existing comment output for large, escaped, and empty values.
🤖 Datadog Autotest · Commit 8702d7e · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This comment has been minimized.
This comment has been minimized.
🟢 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. |
vandonr
left a comment
There was a problem hiding this comment.
nice perf improvement, the downside I see is that now we manually have to
- ensure values are encoded before they are appended
- keep in sync the size computation and the actual appending
(nothing in the code enforcing those)
We could just prepare all the strings, and pass them as a list of key/value pairs to a function that'd then do one pass to encode and compute the size, and a second pass to actually append to the SB. This would mean allocating a collection though...
I think this is a fair point. For this PR, I’d prefer to keep the fixed fields explicit and avoid intermediate allocations. Missing a field from the capacity calculation would only cause buffer growth, not incorrect output. The regression tests cover encoding and comment content. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
0e0ad8c
into
master
What Does This Do
Size the DBM comment buffer from the URL-encoded fields instead of allocating a 1,024-character buffer. This reduces excess allocation for short comments and avoids buffer growth for larger comments.
Preserves the cached static prefix, encodes each dynamic value once, and keeps comment content unchanged. Applies to the shared builder used by JDBC and MongoDB.
Includes regression tests and a committed JMH benchmark with reproduction instructions.
Benchmark results for complete SQL comment injection:
Short inputs allocate 856–928 fewer bytes per operation and take 12–17% less time. Escaped-input timing intervals overlap; that case demonstrates allocation savings only. These measurements do not establish application throughput gains.
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]