-
Notifications
You must be signed in to change notification settings - Fork 768
Delay store.UserByID in RefreshFeed #2984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
jvoisin
added a commit
to jvoisin/v2
that referenced
this issue
Dec 8, 2024
In internal/reader/handler/handler.go:RefreshFeed, there is a call to store.UserByID pretty early, which is only used for originalFeed.WithTranslatedErrorMessage(localizedError.Translate(user.Language) Its only other usage is in processor.ProcessFeedEntries(store, originalFeed, user, forceRefresh), which is pretty late in RefreshFeed, and only called if there are new items in the feed. It makes sense to only fetch the user's language if the error localization function is used. This commit also makes `processor.ProcessFeedEntries` take a `userID` instead of a `user`, to make the code a bit more concise. This should close miniflux#2984
jvoisin
added a commit
to jvoisin/v2
that referenced
this issue
Dec 8, 2024
In internal/reader/handler/handler.go:RefreshFeed, there is a call to store.UserByID pretty early, which is only used for originalFeed.WithTranslatedErrorMessage(localizedError.Translate(user.Language) Its only other usage is in processor.ProcessFeedEntries(store, originalFeed, user, forceRefresh), which is pretty late in RefreshFeed, and only called if there are new items in the feed. It makes sense to only fetch the user's language if the error localization function is used. Calls to `store.UserByID` take around 10% of the CPU time of RefreshFeed in my profiling. This commit also makes `processor.ProcessFeedEntries` take a `userID` instead of a `user`, to make the code a bit more concise. This should close miniflux#2984
WShihan
pushed a commit
to WShihan/miniflux
that referenced
this issue
Feb 23, 2025
In internal/reader/handler/handler.go:RefreshFeed, there is a call to store.UserByID pretty early, which is only used for originalFeed.WithTranslatedErrorMessage(localizedError.Translate(user.Language) Its only other usage is in processor.ProcessFeedEntries(store, originalFeed, user, forceRefresh), which is pretty late in RefreshFeed, and only called if there are new items in the feed. It makes sense to only fetch the user's language if the error localization function is used. Calls to `store.UserByID` take around 10% of the CPU time of RefreshFeed in my profiling. This commit also makes `processor.ProcessFeedEntries` take a `userID` instead of a `user`, to make the code a bit more concise. This should close miniflux#2984
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
internal/reader/handler/handler.go:RefreshFeed
, there is a call tostore.UserByID
pretty early, which is only used fororiginalFeed.WithTranslatedErrorMessage(localizedError.Translate(user.Language)
Its only other usage is inprocessor.ProcessFeedEntries(store, originalFeed, user, forceRefresh)
, which is pretty late inRefreshFeed
, and only called if there are new items in the feed. It would make sense to have the error messages localization function get the user's language on its own instead.It takes around 10% of the CPU time of
RefreshFeed
in my profiling:This issue is part of #2900
The text was updated successfully, but these errors were encountered: