-
Notifications
You must be signed in to change notification settings - Fork 140
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 ruby program by memory #106
base: master
Are you sure you want to change the base?
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.
✅ Круто, что получилось в два раза быстрее первого задания, да?
- можно с константным потреблением памяти переварить любой объём входящих данных
|
||
### Находка №5 - Вызов split при чтении строк из файла | ||
- все отчеты указывают на это | ||
- не присваивать переменной результат вызова метода, а передать ему блок |
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.
да split with block в этом кейсе крутое решение
@@ -69,78 +121,61 @@ def work | |||
# - Хоть раз использовал IE? + | |||
# - Всегда использовал только Хром? + | |||
# - даты сессий в порядке убывания через запятую + | |||
total_users = 0 | |||
total_sessions = 0 | |||
unique_browsers = Hash.new(0) |
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.
Set?
Удалось улучшить метрику системы с *того, что у вас было в начале, до того, что получилось в конце* и уложиться в заданный бюджет. | ||
|
||
*Какими ещё результами можете поделиться* | ||
Удалось улучшить метрику системы до 23 MB при обработке файла любого размера и уложиться в заданный бюджет. |
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.
что-то в кейс-стади не вижу шага про переписывание в потоковом виде, хотя это сделано
Получилось в два раза быстрее чем при оптимизации по процессору в первом задании:
valgrind massif запустить не удалось, отваливается с ошибкой: