Skip to content
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 #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

homework №2 #102

wants to merge 1 commit into from

Conversation

ksilex
Copy link

@ksilex ksilex commented Oct 29, 2023

No description provided.

Copy link
Collaborator

@spajic spajic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По коду всё чётко сделано, по замерам/профилированию см комменты

@@ -0,0 +1,104 @@
За основу взял оптимизированный по CPU код из первого задания
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


Первый отчет memory profiler
```
MEMORY USAGE: 122 MB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не корректно смешивать замеры и профилирование

Само присутствие memory_profiler увеличивает потребление памяти

Правило: Замеры отдельно - профилирование отдельно

![Alt text](<images/Screenshot from 2023-10-29 19-00-19.png>)
Пик потребления не достигает даже 1мб, пробовал по разному запускать, результат не меняется, всегда пик 3.1kb, то же самое происходит и с heaptrack
![Alt text](<images/Screenshot from 2023-10-29 19-02-30.png>)
Но простой прогон с puts в конце показывает
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, см коммент выше

```
MEMORY USAGE: 30 MB
```
Программа теперь выполняется примерно за 9.6 секунд
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 быстро и с минимальным потреблением памяти 👍

Comment on lines +98 to +99
Пик потребления не достигает даже 1мб, пробовал по разному запускать, результат не меняется, всегда пик 3.1kb, то же самое происходит и с heaptrack
![Alt text](<images/Screenshot from 2023-10-29 19-02-30.png>)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возможно программа не запускается / либо что-то не работает

File.foreach(ENV['DATA_FILE'] || filename || 'data.txt', chomp: true) do |line|
column_number = 0

line.split(',') do |column_value|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Плюсую split with block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants