-
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
Homework 2 #124
base: master
Are you sure you want to change the base?
Homework 2 #124
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.
✅
* [2025-02-12 22:53:59 +0400] Memory usage: 255.00 MB | ||
* [2025-02-12 22:54:01 +0400] Memory usage: 281.00 MB | ||
* [2025-02-12 22:54:03 +0400] Memory usage: 304.00 MB | ||
* [2025-02-12 22:54:05 +0400] Memory usage: 334.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.
вот, сразу всё видно - 22МБ чисто для старта; потом заргузка файла; потом плавный рост со временем
То же самое проделываю и с предыдущей строкой. | ||
- Метрика уменьшилась на 54 Мб на 50_000 срок | ||
{"3.3.6":{"gc":"enabled","time":14.16,"gc_count":128,"memory":"215 MB"}} | ||
Кратно уменьшилось количество срабатываний gc |
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.
👍 вот это хороший инсайт
Избавился от Date.parse, он также не нужен. | ||
|
||
Добавил # frozen_string_literal: true | ||
- Количество потребляемой памяти уменьшилось на 160MB на 50_000 строк |
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.
да, но непонятно что как сработало из-за того что объединили много изменений в один шаг
|
||
*Какими ещё результами можете поделиться* | ||
Кажется для более точной оценки потребления памяти необходимо учитывать память которая была выделена |
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.
нам не так важно обычно сколько именно было добавлено дополнительно; важно в результате просто сколько процесс потребляет (например чтобы в лимиты в k8s вписываться)
# frozen_string_literal: true | ||
|
||
class MemoryReporter | ||
DEFAULT_LIMIT_MB = 700 |
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.
70 же
|
||
it 'consumes no more than 70 MB of memory' do | ||
expect { work('data_large.txt', 'result.json') } | ||
.to perform_allocation(70_000_000).bytes |
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.
perform_allocation это не то; нам надо MAX RSS оценить, а не кол-во аллокаций и не объём выделенной памяти
No description provided.