-
Notifications
You must be signed in to change notification settings - Fork 47
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
ДЗ №8 #21
base: master
Are you sure you want to change the base?
ДЗ №8 #21
Conversation
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.
Благодарю за работу ✅
`elsif scope.matches.where(id: object.id).exists?` | ||
- Пока проверял изменение, также заметил что мемоизация в сериалайзере не работала: | ||
``` | ||
def superlike |
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.
оо, суперлайки ))
@superlike ||= object.find_super_like(scope.id) | ||
end | ||
``` | ||
Стал разбираться, и оказалось что функция в некоторых случаях возвращает nil и такой вариант мемоизации не работает, |
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.
Да, есть такая ловушка
запросы с `?limit=500` и тд). | ||
|
||
### Результат: | ||
- С помощью проделанной оптимизации, удалось сократить потребление памяти проекта с 3.6 ГБ до 3 Гб. Причиной оказалось |
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.
💪
No description provided.