-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
perf: squash all migrations #2598
perf: squash all migrations #2598
Conversation
Let's gooo. That time improvement is huge |
@Jamiras One thing I'm curious about when you review this PR: are you able to run tests in parallel mode?
I believe Pest uses a different parallel testing engine than PHPUnit does. I am not sure how a Windows machine will react when parallel testing mode is used, but if things are fine, we may be able to switch the pre-push hook to use parallel testing. |
I still run RAWeb in a Ubuntu VM within Windows, so I doubt I can provide the information you're looking for. |
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.
While I did see a significant performance increase using the squashed migrations, I didn't see much of a difference moving to pest.
php artisan test
(master): 157.34s
php artisan test
(after): 102.13s
vendor/bin/pest
: 100.75s
php artisan test --parallel
(master): 43.47s
php artisan test --parallel
(after): 29.85s
vendor/bin/pest --parallel
: 27.49s
I've also confirmed that sail migrated:fresh --seed
generates a workable site.
Sorry @Jamiras, I think I managed to confuse myself very much here. I think the issues should be addressed now though. My intention was to also squash 2024_08_07_000000_update_emailconfirmations_table.php. I've confirmed migrating a fresh database & tests are now all working again. |
A prep step for upgrading to Laravel 11. (ref)
I've confirmed that migrating a fresh database still works. All migrations in platform, community and the migrations root folders have been deleted. I left upcoming alone. In the platform and community folders, I added .gitkeep files so the empty folders wouldn't get blown away by git.
By squashing migrations, we also manage to bring down non-parallel test execution time by roughly 33%. On my machine it decreases from 180s to 120s. Parallel execution time decreases from 30s to 21s.
Additionally, I've added Pest as a dependency. Pest seems to magically take over test execution when installed -- I found during local benchmarks that this also made a ~5% improvement in test execution time.
Performance improvements are noticeable in CI as well.
Once we are on Laravel 11, we should get another significant improvement in sqlite testing performance.
Before
After