Skip to content

Conversation

@alexrails
Copy link

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.

Отличная работа, респект!

```bash
Finished in 6 minutes 36 seconds (files took 7.37 seconds to load)
7673 examples, 0 failures
Line Coverage: 94.95% (12600 / 13270)
Copy link
Collaborator

Choose a reason for hiding this comment

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

это 13к строк? выглядит маловато, точно coverage корректнг работает?

***
### Оптимизация - 2
Решил `ударить по площадям` дабы еще меньше сократить время на feedback loop и
написал скрипт который заменяет все вхождения `create` на `build_stubbed`, если тест проходит, то оставляет изменение.
Copy link
Collaborator

Choose a reason for hiding this comment

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

да, хороший подход!

Copy link
Collaborator

Choose a reason for hiding this comment

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

сейчас же ещё AI развился. можно что-то в этом духе сделать с промптом вида попробуй оптимизировать тесты не меняя сути, исходя из вот таких подсказок (create -> build_stubbed, что-то ещё...)

Top 5 slowest suites (by `let` time):

Boardgames::RollDice::MegaRoll (.../mega_roll_spec.rb:6) – 00:20.066 of 00:26.192 (401)
↳ player – 2666
Copy link
Collaborator

Choose a reason for hiding this comment

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

😬 😬 😬


Промежуточный итог:
- в последовательном режиме ускорение с `5 minutes 35 seconds` до `4 minutes 20.5 seconds`
- в параллельном режиме улучшения не произошло: `3 minutes 8.3 seconds`
Copy link
Collaborator

Choose a reason for hiding this comment

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

зависит от компьютера, но если комп хороший, то можно и 6+ процессов параллельно

```

Оптимизировал каждый из этих тестов следующим образом:
- Строил `flamegraph` отчет по тесту, где видна проблемная фабрика
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

## TODO:
Запланировал на следующую неделю продолжить оптимизацию и использовать `stackprof`.

План построить json отчет с сэмплированием и найти точки роста с использованием `speedscope`.
Copy link
Collaborator

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