High Memory Usage while compiling astra bin #62
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ArkForgeLabs/Astra#62
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm not sure if this is astra specific issue (because of type-level programming? Have not checked the repo) or is an issue at all but when cargo reaches the end to compile astra's binary, its memory usage steadily climbs to around 1 GB.
This is on windows, on release build. I have not tested on linux.
Note: This is not the case on debug build
This is not Astra issue but it is to be expected. The release builds focus on highest possible optimizations, which hinders speed and memory usage but results in an amazing output that is incredibly performant.
Some things that can help, in case you're using Rust in general and do not want high memory usage, may be looking into sccache and mold. You can also modify Astra's Cargo.toml and remove this section from it and compiling again:
Thanks for the quick response. Makes sense. Have you checked how much performance you gain from this? I also noticed a decrease of 10% in binary size for this release profile compared to the regular release build.
I have not benchmarked the performance gains compared to a normal release build, but I am sure of the higher performance due to some things this maximum optimized profile has, that you can read here: https://doc.rust-lang.org/cargo/reference/profiles.html
Essentially it is able to run some constant codes at compile time to save on performance, better overall linking ability, dead code elimination, ...
closing due to not being an issue and hopefully resolved