Skip to content

perf: add ETS cache to list/1 and reduce diff processing reductions#28

Open
filipecabaco wants to merge 1 commit into
perf/remove-group-reversefrom
perf/ets-list-cache
Open

perf: add ETS cache to list/1 and reduce diff processing reductions#28
filipecabaco wants to merge 1 commit into
perf/remove-group-reversefrom
perf/ets-list-cache

Conversation

@filipecabaco
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Adds an ETS cache to list/1 to avoid hitting the Tracker GenServer when N channel processes read presence state concurrently. The cache is lazily populated on first access per topic and kept warm by diffs. Benchmarks show 1.8–2.1x faster median and 3–4x better 99th percentile under 100 concurrent callers.

Also removes the redundant Enum.reverse from group/1 (called twice per topic per diff cycle), saving 7–15% scheduler reductions at production scale.

Adds an ETS cache to list/1 to avoid hitting the Tracker GenServer when N channel processes read presence state concurrently. The cache is lazily populated on first access per topic and kept warm by diffs. Benchmarks show 1.8–2.1x faster median and 3–4x better 99th percentile under 100 concurrent callers.

Also removes the redundant Enum.reverse from group/1 (called twice per topic per diff cycle), saving 7–15% scheduler reductions at production scale.
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