Repository navigation
test(benches): time guards, imports and render - #553
Merged
Merged
Conversation
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.
Stacked on #550 (the wasmtime advisory fix), so the
auditjob here is green. The base isfix/wasmtime-49-0-5; once #550 merges, retarget this tomain(gh pr edit --base main) before that branch is deleted.Adds Criterion benches for engine paths that had none, a weekly workflow, and two
justrecipes. Three commits: the benches that need no infrastructure, the ones that need Docker, and the review fixes.Benches that need no infrastructure (
just bench)dpp-commonrequest_guardsvalidate_public_https_url,ip_is_disallowed) and the idempotencypolicy_forlookupdpp-integratorimport_parsevalidate_row, and the CPU side of a 1000-row importdpp-renderrender_pagebuild_qr_svgBenches that need Docker (
just bench-infra)dpp-dalpg_repolist,countandfind_by_identityat 100, 1,000 and 10,000 passports;create,update, the primary-key reads; auditappend; API-key lookupdpp-vaultpublish_servefloor_info(no database) is the loopback cost to subtractdpp-nodenats_throughputdpp_dal::test_harness::start_pg, the one Postgres harness, sojust harness-checkstays green.just bench-infraruns them throughscripts/shared-test-pg.sh, asjust test-integrationdoes. All three arerequired-features = ["integration-tests"].publish_serveincludes the vault'stests/helpers/mod.rswith#[path]rather than copying its wiring. Its signer is the harness'sMockIdentity, so publish leaves out Ed25519 (that isdpp-core'scryptobench).What the first run showed
One machine, reduced sampling: orders of magnitude, not baselines.
find_by_identity, hit / misslist, first page of 20list, search matching nothingcountPoint operations are 0.15 to 3 ms; over HTTP the floor is 79 µs, create 4 ms, publish 10.5 ms (mock signer), reads 0.53 ms; NATS publish 90 µs.
find_by_identitygrows linearly with the table, hit or miss. Every passport in this fixture is one product (one GTIN) differing only in batch, the worst shape for it.idx_passport_identityis keyed by product group, identifier, thendoc->>'batchId', and the query compares the batch withIS NOT DISTINCT FROM, which a btree does not search. That is my reading, not confirmed withEXPLAIN. The import delta-matcher is built on this lookup (ops/pg/0019_passport_identity_index.sql). Nothing here changes it.New dependency:
criterionIt is already a workspace dependency (since July, used by
dpp-nodeanddpp-plugin-host); this PR adds it as a dev-dependency todpp-common,dpp-integrator,dpp-render,dpp-dalanddpp-vault. No new package entersCargo.lock, only five dependency edges.Apache-2.0 OR MIT, upstreamcriterion-rs/criterion.rsis not archived and was last pushed on 2026-10-13.cargo tree -p dpp-node -e normal -i criterionprints nothing.testpassword, the API keys are rows with a placeholder hash, the signer is a mock, no key material is read.postgres:17,nats:2); nothing is called out to.Left out, on purpose
dpp-plugin-host(battery_*) build the battery plugin from a siblingdpp-coreworking tree, so on a runner they skip with a warning and only the WAT floor runs. Checkingdpp-coreout beside this repository would bench its default branch, not the release this workspace pins, and the plugin is not a published crate. Nothing here reads from adpp-coreworking tree; the lockfile resolves everydpp-*core crate from crates.io at 0.22.0.Cacheis a 68-line adapter and the resolver has no container harness.The workflow
bench.ymlrunsjust benchthenjust bench-infra, weekly and on demand, never on a push or a pull request. A measurement, not a gate; 60-minute ceiling; actions pinned to the SHAsci.ymlandfuzz.ymluse.criterion-reportsartifact, not a cache. The job downloads the last successful run's artifact (actions: readon the job). A cache entry unused for seven days is evicted and a weekly run that starts late can land past that; an artifact is kept 30 days. This repository has no scheduled run yet; the same design is ondpp-core's workflow, where it replaced a cache after a reviewer pointed out the gap.thrpt:,change:,time:,thrpt:.Review findings addressed (third commit)
snapshot-note, which the page's stylesheet defines on every render; it now checksclass="snapshot-note"and that a live render lacks it.<td>value N</td>), not only the last.allow_privateis asserted to accept before it is timed; the XLSX and CSV benches check a cell of the first row, not only the row count;find_by_idandfind_published_by_idassert the passport is there; thepg_reposweep holds a published passport and asserts the draft filter leaves it out.Checked
just checkexits 0 on the branch tip: clippy with-D warningsover every target including the Docker benches, 1636 of 1636 tests,harness-check, the audit register,cargo deny.cargo test --benchesruns every new bench once in Criterion's test mode, the Docker ones against a real Postgres.just bench-infra's command, with reduced sampling added, exits 0 and runs all three Docker benches in release mode.Not run: the workflow itself (it needs a runner; Run workflow on this branch exercises it),
gh run download, and a full-lengthcargo benchfor baselines.