Hi all! :wave:
Following up on the open note in the Developer Performance Guide ("Count Database Queries per API Test: Is it possible?") and the recent great work on DB query scaling in #12740 and #12729:
I put together a working POC integrating QuickPerf (JUnit 5) into our test suite on my fork:
:link: POC PR: https://github.com/tuannx/dataverse/pull/3
datasource-proxy (Trade-offs)Since we already have datasource-proxy 1.11.0 in develop, here is a quick look at how the two compare:
| Aspect | Direct datasource-proxy (Current) |
QuickPerf (POC) |
|---|---|---|
| Ergonomics | Manual clear(), lambda wrapping, manual asserts |
Declarative annotations (e.g. @ExpectMaxSelect(25)) |
| N+1 Detection | Runs against 2 dataset sizes (e.g. 50 vs 100 files) to check slope | Catches N+1 on a single dataset via prepared statement parameters |
| Failure Diagnostics | Bare assert (expected < 5, was 809); requires manual SQL log inspection |
Dumps the exact repeated SQL statements & parameter diff in test output |
| Safety Guards | None out of the box | Built-in @ExpectUpdate(0), wildcard scan checks, batching checks |
| Dependency & Maintenance | In-tree, zero new dependencies | Adds test-scoped lib. Note: Upstream QuickPerf master has merged datasource-proxy 1.11.0, but a new Maven Central release is still pending (latest published is 1.1.0). |
Would the core team prefer:
datasource-proxy 1.11.0 and writing a lightweight internal test utility inspired by QuickPerf's assertion pattern?Would love to hear thoughts from @Philip Durbin ๐ , @Oliver Bertuch and @Eryk Kulikowski !
@Oliver Bertuch you were interested QuickPerf. Please see above. What do you think?
I'm happy if @Tony Nguyen wants to have a go at this! It would be interesting to see and I appreciate someone continuing the work I started (also very happy to see @Eryk Kulikowski just used the framework :smiley_cat: ).
Some (helpful?) comments:
@JpaPerformanceTest. Adding @QuickPerfTest to it is a low hanging fruit, auto-enabling all existing tests to use QuickPerf. (You probably saw how it also triggers wiring up the datasource, Testcontainers, etc)Last updated: Nov 02 2026 at 07:01 UTC