forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parallel unit test runners (FuelLabs#4395)
## Description closes FuelLabs#3953 This PR adds parallel test runners to improve our test execution times by utilizing the fact that each test is actually completely separate from each other. Also a flag `--test-threads` added to `forc-test` to manually control number of thread used for execution. Simple benchmarks taken from my local system with m1 max can be seen in below: ( *Each config is executed 10 times)* | Num Threads | Average Time | | ----------- | ----------- | | 1 | 1.019 ms | | 2 | 938 ms | | 4 | 883 ms | As it can be seen speed-ups aren't great as this includes building as well which is done with single thread. So I tested just building with tests enabled on the same project (which is sway-lib-std btw) which takes 810ms (again averaged 10 times). So after I normalize the results above with this data | Num Threads | Average Time | | ----------- | ----------- | | 1 | 209 ms | | 2 | 128 ms | | 4 | 73 ms | Speed-ups are more visible with more complex tests with increased number of tests.
- Loading branch information
1 parent
45e826b
commit 91ed981
Showing
6 changed files
with
150 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters