[Zero] create core classes and initial measure#164
Open
Kroch4ka wants to merge 5 commits intohardcode-dev:masterfrom
Open
[Zero] create core classes and initial measure#164Kroch4ka wants to merge 5 commits intohardcode-dev:masterfrom
Kroch4ka wants to merge 5 commits intohardcode-dev:masterfrom
Conversation
spajic
approved these changes
Mar 20, 2025
|
|
||
| gem 'stackprof' | ||
| gem 'ruby-prof' | ||
| gem 'vernier', '~> 1.0' |
| 1. Вынес всю бизнес-логику в отдельный сервисный класс с опциональными аргументами, такими как count_lines (необходимое кол-во строк для обработки, которое берётся из исходного файла), with_progress_bar (добавляет progress bar для визуальной оценки быстроты выполнения тех или иных участков) | ||
| 2. Добавил класс Measurer, который ответственен за вывод метрики | ||
| 3. Добавил класс Profiler, который ответственен за профилирование и вывод результатов в разных видах | ||
| 4. В каждой итерации я запускал Measurer - оценивал метрику -> запускал Profiler - изучал bottlenecks -> выполнял итерацию по оптимизации -> запускал Measurer и опять оценивал метрику. И так по кругу. |
| - как изменилась метрика | ||
| - как изменился отчёт профилировщика - исправленная проблема перестала быть главной точкой роста? | ||
| - Одну из главных точек роста я также изначально выявил в flat отчёте ruby_prof - парсинг даты | ||
| - Решил воспользоваться strptime, чтобы не тратилось время на дополнительный парсинг |
Collaborator
There was a problem hiding this comment.
с датой можно ничего не делать, она сразу в нужном формате
| def with_progress_bar(bar) | ||
| bar&.progress = 0 | ||
| yield | ||
| bar&.progress = 100 |
Collaborator
There was a problem hiding this comment.
не понял, какой смысл в таком прогресс-баре, который с нуля прыгает сразу на 100
в таком случае наверно проще puts сделать один или два раза
| - как вы решили её оптимизировать | ||
| - как изменилась метрика | ||
| - как изменился отчёт профилировщика - исправленная проблема перестала быть главной точкой роста? | ||
| - Главную точку роста я изначально выявил в flat отчёте ruby_prof - формирование списка уникальных браузеров |
Collaborator
There was a problem hiding this comment.
там главное изменение - в группировке сессий по юзерам в hash user_sessions, а не формирование уникальных браузеров
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.