Document pagination performance issues from PR #33#36
Merged
Conversation
Investigation reveals three issues causing slowdown: 1. Cache invalidation (one-time): URL changes invalidated ETags 2. Extra API calls for exactly 100 items: Main issue causing 23-50% slowdown for affected users 3. No multi-page caching: Minor cumulative impact The main culprit is issue #2: current logic makes an extra API call when result sets have exactly 100 items because it can't distinguish between 'exactly 100 total' and '100 with more pages'. Solution: Use GitHub's Link header to detect pagination instead of guessing based on result count. Files: - PAGINATION_ANALYSIS.md: Complete technical analysis with impact tables - PAGINATION_FIX_POC.md: Implementation guide showing how to fix issue #2 For users following 100 people where 30% have exactly 100 items: - Current: ~391 API calls - After fix: ~301 API calls (23% reduction)
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.
Summary
Investigation of pagination slowness introduced in PR #33 reveals three performance issues, with one main culprit causing significant slowdown for certain user scenarios.
Issues Identified
1. Cache Invalidation (One-time)
/user/followingto/user/following?page=1&per_page=100invalidated all ETag caches2. Extra API Calls for Exactly 100 Items⚠️ Main Issue
Real-world impact: For user following 100 people where 30% have exactly 100 items in some category:
3. No Multi-Page Caching
Solution Proposed
Use GitHub's
Linkheader (which explicitly indicatesrel="next") instead of guessing based on result count.Files Added
Recommendation
Implement the Link header solution to eliminate the extra API calls. The fix is straightforward and uses GitHub's standard pagination mechanism.
Related
Follows up on #33