-
Notifications
You must be signed in to change notification settings - Fork 136
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
task 2 (Gregory Paraschevin) #94
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.
Very nice work!
source 'https://rubygems.org' | ||
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | ||
|
||
ruby '3.2.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.
👍
|
||
### Вот как я построил `feedback_loop`: | ||
1. Запускаем профилировщик, находим главную точку роста | ||
2. Кастуем различную магию, делающую плохой код в оптимизационный! |
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.
=)
``` | ||
massif-visualizer на 500 000 строк (видно, что еще много работы) | ||
|
||
![](https://i.imgur.com/xIu31hU_d.webp?maxwidth=1520&fidelity=grand) |
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.
Очень наглядно всё
|
||
Хотелось дополнительно отметить, что я активно занялся внедрением и проработкой подключения на jemalloc нашего рабочего проекта (вилка редмайна), ибо там очень выражены проблемы с утечкой памяти. Но впоследствии думаю подниму еще этот кейс на следующих неделях. Ну и в качестве десертика, то вот данные с графаны с ярко выраженным раздуванием. :) | ||
|
||
![](https://i.imgur.com/s0ecW4b.png) |
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.
😬😬😬
423067 "session" | ||
423067 /home/nouara/projects/rails_optimization/rails-optimization-task2/task-2.rb:79 | ||
``` | ||
- Заменяю Array на SortedSet, начинаю использовать оптимизированный json (oj) и просто безумно гениальную идею с push_object с push_value от OrdinaryMagic. Спасибо ему за здоровый сон и спокойные нервы. |
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.
Да, так намного удобнее чем вручную строчку json-а дописывать, пытаясь нигде не ошибиться
memory_profiler
ruby-prof
в режимеFlat
;ruby-prof
в режимеGraph
;ruby-prof
в режимеCallStack
;ruby-prof
в режимеCallTree
c визуализацией вQCachegrind
;stackprof
;flamegraph
с помощьюstackprof
и визуализировать его вspeedscope.app
;valgrind massif visualier
и включить скриншот в описание вашегоPR
;