Skip to content

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