-
Notifications
You must be signed in to change notification settings - Fork 104
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
Task - 3. #85
base: master
Are you sure you want to change the base?
Task - 3. #85
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.
Лайк, хорошая работа 👍
<%#= render trip.bus.services %> | ||
</ul> | ||
<% end %> | ||
<%= '=' * 52 %> |
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.
хех, первый раз такое представление делимитера в этом ДЗ, лайк
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.
Если удалить паршлы и заинлайнить их, то рендерится быстрее конечно
Но есть возможность использовать паршлы и не убивать перформанс: рендеринг коллекций
Там можно даже шаблон делимитера задать аргументом: https://guides.rubyonrails.org/layouts_and_rendering.html#spacer-templates
nil | ||
end | ||
|
||
def add_item(collection, item_name) |
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.
nice implementation 👍
s = Service.find_or_create_by(name: service) | ||
services << s | ||
Benchmark.bm do |x| | ||
x.report('Clearing database') do |
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.
Очистку данных и загрузку лучше бы ещё в транзакцию завернуть
@@ -0,0 +1,176 @@ | |||
#№ Оптимизация импорта данных | |||
Установил `gem 'annotate'` для того, что бы увидеть зависимости, поля и индексы таблиц. |
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.
👍
Creating data 35.507971 0.369157 35.877128 ( 44.157531) | ||
``` | ||
|
||
Из результатов видно, что мы достигли желаемого результата в бюджет в одну минуту. |
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.
👍
|
||
- Из анализа запросов `rack-mini-profiler` видно, что есть проблемы с индексами таблиц. | ||
Для анализа проблем с индексами установим `gem 'pghero'` и `gem 'pg_query'`. | ||
Обозримых проблем инструмент не дал. |
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.
Обычно в этом ДЗ pghero прям показывает все индексы, которые стоит создать
Возможно не было достаточно данных у него для анализа / или что-то не заработало
No description provided.