Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upstatic array of zeroes can take minutes to lint check #55795
Comments
estebank
added
I-slow
A-mir
labels
Nov 8, 2018
ishitatsuyuki
added
I-compiletime
and removed
I-slow
labels
Nov 9, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kazcw commentedNov 8, 2018
•
edited
This program takes an inordinate amount of time and memory to compile (it's worse if the array is actually used, but this is a minimal test case):
I was hoping this would be a viable way to get a big chunk of
.bssso I don't have to depend on anmmapcrate to get a lot of static zeroes, but the effect on compile time makes that impractical.If I run
rustc -Z time-passes, the big offender is:time: 47.666; rss: 2486MB lint checkingAlthough the time (and memory) is reportedly spent checking lints, setting
--cap-lints allowdoesn't make any difference. I'm guessing the "lint checking" pass includes some things that need to be checked even if lints are suppressed? If not, it seems like a separate issue is that a lot of work could be saved with cap-lints set (e.g. when compiling dependencies).Here are the top results from
perf report, forrustc 1.32.0-nightly (25a42b2ce 2018-11-07):So it looks like miri is actually creating the array and folding over it. I know it's not going to find any problems, because I have ECC memory😆 .
There are already some bugs relating to slow compilation of large arrays, with the most relevant I could find being #37155, #49330. I think this is separate from those cases because: