Skip to content

Task1(ipcross)#15

Open
ipcross wants to merge 2 commits intospajic:masterfrom
ipcross:master
Open

Task1(ipcross)#15
ipcross wants to merge 2 commits intospajic:masterfrom
ipcross:master

Conversation

@ipcross
Copy link

@ipcross ipcross commented Mar 11, 2019

No description provided.

Copy link
Owner

@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.

Аппрув, но в case-study не хватило конкретных цифр эффекта от каждого изменения.
В итоге не понятно, что помогло, а что нет. И на основании чего решили делать, то что не помогло.

- измерение общего времени выполнения с помощью `Benchmark.realtime`
- профилирование программы с помощью `ruby-prof`

Время выполнения исходного кода на тестовом файле 50000 строк(2Мb) составляет: 59-61 секунд.
Copy link
Owner

Choose a reason for hiding this comment

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

Минута - уже довольно долго, можно отвлечься и потерять фокус, лучше было бы взять объём данных поменьше.

### Ваша находка №1
О вашей находке №1
Больше всего потребление памяти занимает формирование массивов пользователей и сессий.
Решение, замена конкатенации на модификацию массивов `users` и `sessions` 'in place' с помощью `Array#push`
Copy link
Owner

Choose a reason for hiding this comment

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

Хорошо бы было измерить и описать эффект

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