Skip to content

[Yaroslavzev] #107

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[Yaroslavzev] #107

wants to merge 3 commits into from

Conversation

Yaroslavzev
Copy link

@Yaroslavzev Yaroslavzev commented May 11, 2024

PR содержит оптимизированную версию Rails приложения, в которой:

  • rake reload_json[fixtures/large.json] должнен выполняться в пределах минуты;
  • загрузка страницы автобусы/Самара/Москва должна укалывать в 200 мс;

@Yaroslavzev Yaroslavzev marked this pull request as ready for review May 11, 2024 19:28
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.

Nice work! ✅

@@ -1 +1 @@
2.6.3
3.2.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

<% end %>
</ul>
<%= render "delimiter" %>
====================================================
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for your information, есть в рендеринге коллекций возможность задать разделитель параметром: https://guides.rubyonrails.org/layouts_and_rendering.html#spacer-templates

И в целом с использованием render collection производительность не такая ужасная как было тут с рендерингом циклом

* Вторым шагом было добавлние загрузки связанных объектов Services с помощью `includes` для Trip и Bus. Время загрузки уменьшилось до 548ms
- Логи показали много обращений к шаблон для рендера
* Создание общего шаблона для рендера без вложенных шаблонов уменьшило время загрузки страницы `автобусы/Самара/Москва` до 178ms
- Добавление индексов согласно рекомендациям PG Hero сократило время загрузки до 156ms
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