-
Notifications
You must be signed in to change notification settings - Fork 30
Performance Improvements for the new combined front page #1697
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
Conversation
f31bcb7 to
4bfcc37
Compare
efb8031 to
c712fc9
Compare
4bfcc37 to
3cefd8a
Compare
3cefd8a to
76bce66
Compare
c712fc9 to
794797b
Compare
af1ca73 to
1f11333
Compare
76bce66 to
ab65434
Compare
1f11333 to
3da9f39
Compare
ab65434 to
7ee9a1c
Compare
The base branch was changed.
- add caching to the `ContentRepository` (it still works without the cache being populated) for - user follows - user magazine subscriptions - user domain subscriptions - user blocks - user magazine blocks - user domain blocks - user moderated magazines - add event subscribers to each event changing one of those collections to clear the cache
- add caching to the count query of the `NativeQueryAdapter` (for pagination) - hard set the count to 1000 pages if the result set is expected to be large
7ee9a1c to
6e669d6
Compare
|
|
||
| $numResults = null; | ||
| if (!$criteria->magazine && !$criteria->moderated && !$criteria->favourite && Criteria::TIME_ALL === $criteria->time && Criteria::AP_ALL === $criteria->federation && 'all' === $criteria->type) { | ||
| if ('test' !== $this->kernel->getEnvironment() && !$criteria->magazine && !$criteria->moderated && !$criteria->favourite && Criteria::TIME_ALL === $criteria->time && Criteria::AP_ALL === $criteria->federation && 'all' === $criteria->type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally you don't have test code or switches in production code. So the way to do this is most likely stubbing or mocking the interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally yes, but this is a performance shortcut which is only relevant in production, as it does not report the actual number of results anymore. How would I be making this an interface that shares the same code but not this performance workaround, without duplicating most of the code?
ContentRepository(it still works without the cache being populated) forNativeQueryAdapter(for pagination)I separated it from the other PR (#1696) so it is less convoluted to look at :)