Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Shrink Expr_::ExprInlineAsm. #37445
Shrink Expr_::ExprInlineAsm. #37445
Conversation
On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and reduces the size of `Expr` from 176 to 96 bytes.
|
cc @jseyfried Doing the same for the AST might speed up expansion. @bors r+ |
|
|
|
|
Shrink Expr_::ExprInlineAsm. On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and reduces the size of `Expr` from 176 to 96 bytes. For the workload in #36799 this reduces the RSS for the "lowering ast -> hir" phase and all subsequent phases by 50 MiB, which reduces the peak RSS for that workload by about 1%. Not huge, but it's a very easy improvement. r? @eddyb
I did some more measurements because the above improvement was smaller than expected. Massif showed that this change does make a decent difference. Here are measurements for a cut down version of ostn15_phf that peaks at ~1 GiB instead of ~4.5 GiB. Before:
After:
The I then did some RSS measurements of stage2 compilers via /usr/bin/time. They jump around a bit, but if I take the lowest of 3 runs, the before vs. after improvement is 1108 MB -> 1004 MB, which is a 9% drop. Good. In conclusion, I'm not sure what went wrong with my initial measurements, but I'm confident now that this reduces memory usage for ostn15_phf by about 9%. |
|
Nice wins. |
On 64-bit this reduces the size of
Expr_from 144 to 64 bytes, andreduces the size of
Exprfrom 176 to 96 bytes.For the workload in #36799 this reduces the RSS for the "lowering ast -> hir" phase and all subsequent phases by 50 MiB, which reduces the peak RSS for that workload by about 1%. Not huge, but it's a very easy improvement.
r? @eddyb