Add holistic table event processing benchmark - #7061
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Merging this PR will degrade performance by 0.55%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Re-add test_table_event_deltas, dropped in the harness simplification, so the serialized rows, sort direction, and totals the table benchmark encodes are verified across repeated batches, sharing one _encode_delta helper with the timed path. Replace the counter batch's three increments with two increments and two decrements: the old batch grew the counter every sample, so the computed vars derived from it did strictly more work on each invocation. Both workloads now return state to its starting point between samples.
Add an order-management workload to measure backend event performance beyond counter increments. Six events filter and sort 1,000 dataclass rows, recompute totals, generate deltas, and serialize StateUpdate envelopes through Reflex's JSON encoder.
The benchmark warms state before timing and returns to the same filter and sort direction after each sample. A separate correctness test verifies serialized rows and totals across repeated batches. The README documents how to run it and the measurement boundary: processor lifecycle is included; hydration, network transport, database access, and browser rendering are excluded.
Related to #7056, which includes the original benchmark alongside runtime optimizations. This PR isolates the benchmark and adds repeatable samples, correctness assertions, and run documentation. Encoding is measured through
json_dumps; changes confined to Socket.IO's encoder configuration require updating the benchmark's encoder too.Validation
uv run pyright reflex tests: passed.git diff --check: passed.Repository-wide Ruff checks report unrelated existing issues under
.states.bak/andignore/. The full unit suite was not run; this change only adds benchmark coverage and documentation.No package source or public behavior changes; no changelog fragment included.