Add reusable performance test suite for adapter benchmarking#406
Merged
Add reusable performance test suite for adapter benchmarking#406
Conversation
…st function Agent-Logs-Url: https://github.com/pubkey/rxdb-server/sessions/25af1929-1699-425e-8a59-b76e7e3179d9 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pubkey/rxdb-server/sessions/25af1929-1699-425e-8a59-b76e7e3179d9 Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pubkey
April 14, 2026 15:45
View session
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.
Adds an exported
performanceTest()function so adapter authors can benchmark custom adapters against a standard set of operations. Includes a test running the suite against the Express adapter.Changes
src/plugins/server/performance-test.ts— New module withperformanceTest()that benchmarks 6 operations: bulk write, query, get-by-id, bulk delete, sequential single-doc writes, and replication pull. Returns structuredPerformanceTestResult[]with timing and ops/sec.src/plugins/server/index.ts— Re-exportsperformanceTest,PerformanceTestResult,PerformanceTestOptionstest/unit/performance.test.ts— Runs the suite againstRxServerAdapterExpress, logs results, asserts sanitytest/unit.test.ts— Registers the new test fileUsage for custom adapters
The
PerformanceTestOptionsinterface takes an adapter, a database factory, a port provider, and an optionalbatchSize(default 30). Each test spins up its own server/collection and tears down after measurement.