Skip to content

Reduce Redis roundtrips on the ab_test path#754

Merged
andrehjr merged 3 commits into
mainfrom
reduce-more-redis-roundtrips
Jul 26, 2026
Merged

Reduce Redis roundtrips on the ab_test path#754
andrehjr merged 3 commits into
mainfrom
reduce-more-redis-roundtrips

Conversation

@andrehjr

Copy link
Copy Markdown
Member

Cuts the number of Redis calls made during Split::Helper#ab_test

Changes

  • Drop the redundant exists? roundtrip in Experiment.find and Experiment#save
  • Batch cleanup_old_experiments! into a single pipelined roundtrip instead of two hgets per experiment (was O(N) in the user's experiment count)
  • Batch active_experiments winner lookups into one hmget instead of one hget per experiment
  • Add RSpec matcher to pin the roundtrip counts and guard against regressions

@andrehjr
andrehjr merged commit 8f67693 into main Jul 26, 2026
18 checks passed
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.

1 participant