Skip to content
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

Optimization task 4 #149

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

Conversation

aushev-dev
Copy link

No description provided.

@aushev-dev
Copy link
Author

Честно сказать, в этом задании хотелось бы побольше времени поработать, найти больше точек оптимизации через APM и rack-mini-profiler. Возможно, позже еще доработаю.

@aushev-dev aushev-dev force-pushed the optimization-task-4 branch from bd23a8e to bf2153c Compare March 16, 2025 19:39
@aushev-dev aushev-dev force-pushed the optimization-task-4 branch from bf2153c to c0ba589 Compare March 17, 2025 08:14
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.

✅ 💪 всё чётко, спасибо за работу!

@@ -55,7 +55,9 @@
<% if !user_signed_in? && i == 4 %>
<%= render "stories/sign_in_invitation" %>
<% end %>
<%= render "articles/single_story", story: story %>
<% cache ["v1", story, story.updated_at, story.comments_count, story.positive_reactions_count] do %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Time per request: 149.877 [ms] (mean, across all concurrent requests)
Transfer rate: 857.59 [Kbytes/sec] received
```
- Время обработки всех запросов сократилось в 4 раза с 60 до 15 секунд. Также количество Failed сократилось с 99 до 0.
Copy link
Collaborator

Choose a reason for hiding this comment

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

99 failed - там response size чуть не сходится; видимо есть какие-то отличия от исходного ответа, который берётся за эталон; а при local_production всё стабильно в этом плане


### 2. Отсутствие кеширования partial-ов _single_story.html.erb
- Readme задания и rack-mini-profiler
- Добавил кеширование partial'а, учел, что в него входят счётчики лайков и комментариев.
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Time per request: 71.791 [ms] (mean, across all concurrent requests)
Transfer rate: 1772.19 [Kbytes/sec] received
```
- Время обработки всех запросов сократилось в два раза с 14 до 7 секунд.
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