-
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
Домашняя работа 2 недели #126
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.
✅
Я решил исправить эту проблему, оптимизировав эту программу. | ||
|
||
## Формирование метрики | ||
Для того, чтобы понимать, дают ли мои изменения положительный эффект на быстродействие программы я придумал использовать такую метрику: проверка использования памяти на файле с меньшим количество строк (40000 строк). |
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.
Сорри за духоту, но это не метрика; метрика это число какое-то, которое характеризует вашу систему
- memory_profiler показал, что split строк файла занимает 18.95 MB | ||
- как вы решили её оптимизировать - было решено переделать и написать в "потоковом" стиле | ||
- как изменилась метрика: память уменьшилась с 98.00 MB до 15 MB | ||
- как изменился отчёт профилировщика - обработка строк большого файла теперь занимает 15 MB и 27,47 секунд. |
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.
самый кайф, что на тех же 15МБ можно любой объём данных перелопатить
### Ваша находка №4 | ||
- memory_profiler показал, что получение "Даты сессий через запятую в обратном порядке в формате" занимает 30.83 MB MB | ||
- как вы решили её оптимизировать - решил упростить получение дат сессий | ||
- как изменилась метрика: память уменьшилась с 127.15 MB MB до 98.00 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.
сорри за духоту, но тут лучше уточнить формулировки; "память уменьшилась" звучит не очень конкретно
|
||
def write_user(user, stream_writer) | ||
stream_writer.push_key("#{user.first_name} #{user.last_name}") | ||
stream_writer.push_object |
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.
лайк за stream_writer
|
||
### Ваша находка №5 | ||
- memory_profiler показал, что split строк файла занимает 18.95 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.
хорошо, что сделали несколько итераций до этого, польза++
No description provided.