Repository navigation
perf: hydrate user feed pages with one article_tags pass - #1262
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Author
There was a problem hiding this comment.
✅ Devin Review: No Issues Found
Devin Review analyzed this PR and found no bugs or issues to report.
Custom reviewers
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
Stacked on #1259. The user feed spent most of its time hydrating the 20-article page: SQLite joined
article_tags(no index onarticle_id) once per selected article.findArticlesOfAuthorsandfindArticlesOfAuthorsWithCursornow page article ids into a CTEFAand read the page's tag rows in one pass:AT.tagSeq(thearticle_tagsrowid) pinstagListto the order the current plan already returns, so responses are unchanged. No schema or index changes. Uses SQLite'srowid, like the rest of the app this mapper is SQLite-only.Numbers
Seed: 200 users, 10,000 articles, 50 tags, 19,964 article tags, 20,000 favorites, 4,000 follows. 200 sequential requests per endpoint after 30 warmup, as a user following 20 authors. Run on #1258 + #1259 merged (Java 21 / Boot 3.5).
GET /articlesGET /articles/feedfeed(first: 20)Verification
spotlessCheck test: 70/70 green on this branch (Java 11) and merged onto Upgrade to Java 21 / Spring Boot 3.5 (revives #1185) #1258 (Java 21).Seen while benchmarking, not changed here:
/articles/feedwith an offset past the end returns 500 (emptyin ()inArticleFavoritesReadService.articlesFavoriteCount), before and after this PR; GraphQLfeedstill runs 46 SQL statements per request becauseArticle.authoris resolved per article.Implemented in session Benchmark RealWorld feed on Java 21 stack
Review with Devin · Open in Devin Desktop