-
Notifications
You must be signed in to change notification settings - Fork 195
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
[Zero] create core classes and initial measure #164
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.
✅
|
||
gem 'stackprof' | ||
gem 'ruby-prof' | ||
gem 'vernier', '~> 1.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.
👍
1. Вынес всю бизнес-логику в отдельный сервисный класс с опциональными аргументами, такими как count_lines (необходимое кол-во строк для обработки, которое берётся из исходного файла), with_progress_bar (добавляет progress bar для визуальной оценки быстроты выполнения тех или иных участков) | ||
2. Добавил класс Measurer, который ответственен за вывод метрики | ||
3. Добавил класс Profiler, который ответственен за профилирование и вывод результатов в разных видах | ||
4. В каждой итерации я запускал Measurer - оценивал метрику -> запускал Profiler - изучал bottlenecks -> выполнял итерацию по оптимизации -> запускал Measurer и опять оценивал метрику. И так по кругу. |
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.
👍
- как изменилась метрика | ||
- как изменился отчёт профилировщика - исправленная проблема перестала быть главной точкой роста? | ||
- Одну из главных точек роста я также изначально выявил в flat отчёте ruby_prof - парсинг даты | ||
- Решил воспользоваться strptime, чтобы не тратилось время на дополнительный парсинг |
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 with_progress_bar(bar) | ||
bar&.progress = 0 | ||
yield | ||
bar&.progress = 100 |
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.
не понял, какой смысл в таком прогресс-баре, который с нуля прыгает сразу на 100
в таком случае наверно проще puts сделать один или два раза
- как вы решили её оптимизировать | ||
- как изменилась метрика | ||
- как изменился отчёт профилировщика - исправленная проблема перестала быть главной точкой роста? | ||
- Главную точку роста я изначально выявил в flat отчёте ruby_prof - формирование списка уникальных браузеров |
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.
там главное изменение - в группировке сессий по юзерам в hash user_sessions
, а не формирование уникальных браузеров
No description provided.