-
Notifications
You must be signed in to change notification settings - Fork 22
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
cargo test
takes 8x more time on my laptop after the switch to Miden VM v0.10.5 (from v0.10.3)
#317
Comments
The flamegraph for one of the tests is generated at 65365a0 (Miden VM v0.10.5) via: cargo flamegraph --root --unit-test miden_integration_tests -- rust_masm_tests::instructions::band_i64 |
|
cargo test
takes 8x times after the switch to Miden VM v0.10.5 (from v0.10.3)cargo test
takes 8x more time on my laptop after the switch to Miden VM v0.10.5 (from v0.10.3)
Needed when running `cargo flamegraph --root` for #317
Needed when running `cargo flamegraph --root` for #317
Interesting that changes in 0.10.5 caused this... Are you able to zoom in to the Side note: I use |
Thank you for looking into it. For some reason, when you click on the svg file it opens in the separate tab and zooming does not work, but the mouse-over displays full text. However, if you download the svg file and open the local file, zooming works nicely(on click).
Yes, we use it as well, but here it is not much help. The test is running the compiled MAST 256 times (each on a fresh VM instance) using compiler/tests/integration/src/rust_masm_tests/mod.rs Lines 23 to 40 in 173c48b
I suspect starting and/or shutting down the VM instance became more expensive. |
My guess is that it has something to do with loading the standard library into the assembler/processor. Are we able to run this against the |
Although, the main thing that changed between 10.3 and 10.5 was the merging of adjacent basic blocks - but that shouldn't have such a big impact. |
The major increase in time here is 100% due to the loading of a MAST library, though a subsequent commit to the one you linked modified the compiler to cache the standard library after it is loaded, and simply clone it after that. A similar change was made in the VM, though I can't recall if that has been released yet. This was initially noticed by me when we turned on implicit linking of the standard library (since we went from not linking against it at all in many tests, to linking it in all of them), but the actual overhead comes from the hashing done when loading the MAST. This should be fixed in the current |
I run our tests using almost the tip of the Miden VM EDIT: The tests on CI got back to 15 minutes (vs. ~33 minutes). See #319 |
I'm still getting the same ~16 minutes (just tested and got 15 and a half minutes) in the
Nope, I've been experiencing this issue since last week on the |
Hmm, it was introduced in 1.80.0, which is our MSRV and the same as our current rustc toolchain version, so it shouldn't be unstable. It could be the case though that because it is a nightly toolchain from prior to the stable 1.80.0 release, that it hadn't been marked stable yet. I would expect this not to cause us any issues though either way. |
I'm able to reproduce the issue, but what I was getting at is that the commit you are referencing was from before the fix that addressed the issue. Meaning that, somehow, our fix is no longer working. I definitely want to get to the bottom of that, even if it can be fixed by updating the VM deps to use git temporarily, as it means we are doing something, somewhere, that we shouldn't be. |
In (it is of course possible that something in the above doesn't work as expected). |
@bobbinth To be clear, the issue here is in the latest published release, not One thing I did notice when examining the flamegraph, is that dropping the vectors used to store the decorators gets really expensive when you have a decorator attached to every node in the program (when debug info is enabled, as it always is in the compiler currently) - ~30% of the program runtime is spent just on dropping those. Now, on to the actual issue, and the reason why it appears to be fixed in Because /cc @greenhat |
After the switch to Miden VM v0.10.5 in 65365a0 the
cargo test
takes 16 minutes on my laptop instead of 2 minutes before the switch.Interestingly, on CI time went up only from ~19 minutes to ~32 minutes. I suspect with more cores, the performance degrades more quickly.
The text was updated successfully, but these errors were encountered: