Skip to content

Conversation

@dmi3-bu
Copy link

@dmi3-bu dmi3-bu commented Jul 12, 2021

No description provided.

Copy link
Collaborator

@spajic spajic left a 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
Copy link
Collaborator

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 и такой вариант мемоизации не работает,
Copy link
Collaborator

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 Гб. Причиной оказалось
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants