Skip to content

perf(rrd): [develop] reuse capability checks within calls - #8340

Open
somethingwithproof wants to merge 2 commits into
Cacti:developfrom
somethingwithproof:perf/develop-rrd-version-checks
Open

somethingwithproof wants to merge 2 commits into
Cacti:developfrom
somethingwithproof:perf/develop-rrd-version-checks

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

This change avoids repeated RRDtool capability checks during one graph or update operation. It reuses each result within that call, including a negative result, and starts fresh on the next call. This removes repeated preparation work while preserving generated commands and avoiding a persistent cache.

Implementation details

RRDtool graph construction compares the same version four times, and update batches repeat the skip-past-updates capability check for every timestamp. Reuse each result within its function call, including a false result, and reset it on the next call. Empty update batches perform no version lookup.

The regression executes the production bodies with instrumented I/O, covers two RRD files, six timestamps, versions 1.3/1.4/1.5/1.8, and a return to 1.3. Update checks fall from six to one; graph checks fall from four to one. Commands and reference mutations remain identical.

PHP 8.5.11 through mise: 2,765 Unit tests pass with four existing skips; PHPStan, formatter, sink/hotspot guards and quick/empty poller regressions pass. Five alternating diagnostic rounds show lower median graph-option and batch-update costs, with unchanged allocated memory. Timing ranges overlap and include scheduling outliers; these measurements do not establish production throughput.

The same optimization is carried in #8012 and a minimal 1.2.x companion. Release notes remain in the final changelog PR #8320.

Maintenance companion: #8341. The rewrite #8012 includes this PR as an ancestor. Merge #8340 before #8012; a merge commit preserves that ancestry. If #8340 is squashed, refresh #8012 against the merged develop head before merging it.

Revision and checks

Description scope: target develop, 4 changed files, head 773d61d41. Checked 2026-10-23 03:06:04 UTC.

GitHub check snapshot: 2 passed. Local test figures and earlier CI runs above are recorded evidence for their stated revisions and environments; they do not assert that every check passes at this head.

xmacan
xmacan previously approved these changes Oct 14, 2026
bmfmancini
bmfmancini previously approved these changes Oct 14, 2026

@bmfmancini bmfmancini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-reviewed the incremental commit ('test: measure coverage at the exact PR revision'): a single-line change pinning the changed-coverage checkout to ${{ github.event.pull_request.head.sha }} so coverage evidence always measures the exact reviewed PR revision even when later pushes race the run. All checks pass on the updated head (PHP lanes, changed-coverage, POST guard, docker probe; only Semgrep OSS neutral + unrelated skips). Production code unchanged from my prior review. Approving again.

somethingwithproof added a commit to somethingwithproof/cacti that referenced this pull request Oct 14, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof force-pushed the perf/develop-rrd-version-checks branch from 254b9c8 to 877a68e Compare October 17, 2026 06:11
@somethingwithproof
somethingwithproof force-pushed the perf/develop-rrd-version-checks branch from 877a68e to 3f3ee75 Compare October 17, 2026 07:36
@github-actions
github-actions Bot force-pushed the perf/develop-rrd-version-checks branch 6 times, most recently from 35ee476 to 773d61d Compare October 22, 2026 20:47
@github-actions
github-actions Bot force-pushed the perf/develop-rrd-version-checks branch 2 times, most recently from da54bbc to 215c62c Compare October 26, 2026 20:51
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@github-actions
github-actions Bot force-pushed the perf/develop-rrd-version-checks branch from 215c62c to f22ad6a Compare October 28, 2026 20:47
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants