Optimizing Speed in Shards for Cargo Mutants through Caching #209
-
IntroductionThe purpose of this discussion is to explore potential strategies for optimizing the speed of Key Points for Discussion
Goals of the DiscussionI appreciate all your work and effort you've already done, please let me know whether additional information might be helpful in our quest to optimize our CI workflow. Specifically, I'm interested in understanding if and how we could implement caching for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The difficulty here is that the mutated code is by definition different for each mutant, just as if you were editing it yourself. Changing the code requires a new build to reflect the changes. (It is a new incremental build, so some information is cached.) Similarly, when we change the code, we expect different results, that's the whole point, so we have to run the tests again. If you want to look at it as a cache, then:
Another way to look at this is that cargo build and test results are cached at the granularity of crates. If you split off some code into a smaller crate then both builds and tests will be faster. If you did not already, you should read https://mutants.rs/how-it-works.html. I would say that https://github.com/llogiq/mutagen does something like what you're saying about building a binary only once:
However, it still needs to run the tests for each mutant, and it seems to me that for most trees, including yours, the test time will be longer than incremental builds. |
Beta Was this translation helpful? Give feedback.
The difficulty here is that the mutated code is by definition different for each mutant, just as if you were editing it yourself.
Changing the code requires a new build to reflect the changes. (It is a new incremental build, so some information is cached.)
Similarly, when we change the code, we expect different results, that's the whole point, so we have to run the tests again.
If you want to look at it as a cache, then: