-
Notifications
You must be signed in to change notification settings - Fork 195
task-1(cpu): use benchmarks and profilers for finding speed points #143
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # .gitignore # Gemfile # case-study-template.md # update_reports.sh
# Conflicts: # .gitignore # Gemfile # case-study-template.md # update_reports.sh
# Conflicts: # update_reports.sh
# Conflicts: # update_reports.sh
# Conflicts: # update_reports.sh
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.
✅
.DS_Store | ||
|
||
# Ignore specific file extensions in all directories. | ||
*.txt |
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 @@ | |||
3.3.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.
👍
gem 'ruby-prof' | ||
gem 'ruby-prof-speedscope' | ||
gem 'stackprof' | ||
gem 'vernier' |
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 | ||
## Вникаем в детали системы, чтобы найти главные точки роста | ||
Для того, чтобы найти "точки роста" для оптимизации я воспользовался всеми профайлерами из лекции, чтобы получить опыт. |
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 | ||
|
||
1) Написал тест задав бюджет: 30 секунд и линейной асимптотикой. | ||
2) При выполнении на маленьком data.txt получил логарифмическую асимптотику. |
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.
логарифмическая это лучше линейной (либо опечатка, либо тест некорректный результат показал)
|
||
Добавил новый Firefox Profiler, используя гемы: |
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.
👍 понравилось?
- какой отчёт показал главную точку роста | ||
- как вы решили её оптимизировать | ||
rubyprof - flat |
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.
в чём была проблема - не понятно, как поправили, тоже не понятно
uniqueBrowsers += [browser] if uniqueBrowsers.all? { |b| b != browser } | ||
|
||
# uniqueBrowsers += [browser] if uniqueBrowsers.all? { |b| b != browser } | ||
unique_browsers << browser unless unique_browsers.include?(browser) |
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
RubyProf.measure_mode = RubyProf::WALL_TIME | ||
|
||
result = RubyProf::Profile.profile do | ||
work(ENV.fetch('DATA_FILE', nil), disable_gc: ENV.fetch('DISABLE_GC', true)) |
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.
Внутри метода вроде была тоже какая-то логика про ENV-переменную
По дефолту disable_gc: true лучше не стоит, это временная мера на случай если GC вносит сумятицу в профилирование
DISABLE_GC=$disable_gc DATA_FILE=$filename ruby task-1_vernier.rb | ||
|
||
# Запуск тестов | ||
ruby task-1_test.rb |
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.