Conversation
|
We really need to stop with these out-of-tree proto files :/. They're constantly a cause of CI and build times issues because we have to "force" rebuild them sometimes and its non-trivial to monitor because they're not co-located with the |
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
Some other investigation options:
- debug symbols though then errors are likely worse
moldas a linker if link time is a lot
|
Looking at the CI build/tests it also looks like the rust-cache isn't working. Though that might be because it includes the profile in the cache key, and that was changed. You might want to re-run the actions to see if that's the case. Although I think I set the cache to only save on push into |
Is |
This reverts commit 5f84d07.
Ah, thank you. We were enabling debug-assertions even before under the test-release profile because we explicitly enabled debug-assertions in the profile and also because we passed The build time in CI is now similar to before with 6m 16s but test execution time is now 7m 58s, so a nice improvement over the original ~30 min. I removed all I also combined I tried using the By far the slowest test is now |
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you!
On my machine
make test-provenow compiles in 63s and runs in 11s.
So, on your machine, the combined build + test time went from ~375 seconds to ~75 second, right? Or about 5x improvement?
The build time in CI is now similar to before with 6m 16s but test execution time is now 7m 58s, so a nice improvement over the original ~30 min.
And on CI we went from ~30 mins to ~14 mins, right? So, about 2x improvement?
By far the slowest test is now
create_accounts_with_non_zero_anchor_blockwhich doesn't do any proving. It is slow because it creates$2^16$ blocks with the MockChain to test an account ID creation with something other than the genesis block as the anchor. If we could speed up the creation of fake blocks in the mock chain that would help here. I guess the slow part comes from all the hashing in the MMR operations, not sure if we can cheat here somehow.
Let's create a separate issue for this.
Exactly, yes.
Ah no, when I said "test execution time is now 7m 58s" I should have said the "entire test time", not just the execution time. So it went from ~30mins to ~8mins, so 3.75x improvement. |
This should improve further once you land this on |
The tests on The VM uses the approach we had previously, so maybe worth it wo change it there as well, cc @plafer. |
Optimizes the way we build and run tests.
Profiles
I'm evaluating all of these using the build and test execution times from
make test-prove(with acargo cleanin between) on my computer.Current next
Build time: 304s
Test execution time: 71s
Dev profile
Build time: 33s
Test execution time: 338s
Dev + Opt-Level 1
Build time: 67s
Test execution time: 74s
Dev + Opt-Level 1 + Thin LTO
Build time: 94s
Test execution time: 72s
Conclusion
I think the clear winner is
Dev + Opt-Level 1as it has the lowest build time with a practically equivalent test execution time to the other options (exceptDev). For that reason I renamedtest-releasetotest-dev.Given that it is also not necessary to specifically compile
winterfellwith a higher opt-level because it doesn't bring any additional benefits.Interestingly on my machine the build is 4.5x faster, while in CI it is sadly only a ~2x improvement (from 12m 02s to 6m 08s).
For the execution time, the tests are ~5% slower in CI (4m 24s previously and 4m 42s now) which seems acceptable given the build time improvement.
CI Reuse
What's also interesting is that in this run from another recent PR https://github.com/0xPolygonMiden/miden-base/actions/runs/13933162712/job/38995000040#step:7:1 the
make test-defaultseems to have to completely rebuild whatmake test-buildjust finished doing, judging by the time.In this PR, the change from
test-devalone causes the "second build" to only take another minute (see first CI run from this PR). I removed the$(BUILD_GENERATED_FILES_IN_SRC)from themake test-buildcommand which doesn't seem necessary and that eliminates the "second build" entirely (see second CI run from this PR).The overall CI improvement for the tests from this PR is from 29m 38s to 12m 12s (2.4x).
Let me know if I should try anything else.
closes #1222