80 000 lines project - very slow, about 5 hours, compilation!

This code is the MAVLink protocol handler, and generated by one of the MAVLink specification. It is C/Rust mixed project, so to compile it you will need Rust, CC an any C compiler.

To check how slow rustc is, check this out, and run cargo test in the GroundControl/demo dir

Exactly this project is compiled with error, cause the borrow checker complains in one place.

But anyway, the problem is that compilation is unacceptably slow.


/GroundControl/lib generated API

/GroundControl/demo/src/use_case is generated sample of using generated API

/GroundControl/demo/src/test the test

I generate variation of this project, with same functionality, in C, C++, C#.... They are the compiled in seconds !

What wrong with my Rust project? How can I speed up compilation?


Intel I7-7700K


SSD Samsung 970 PRO

cargo -V

cargo 1.39.0-nightly (ab6fa8908 2019-09-25)

rustc -V

rustc 1.40.0-nightly (22bc9e1d9 2019-09-30)

This sounds like a bug. Could you please report it, with the test case, so that people can profile what the compiler is doing with all that time?

I did, The test is up there. Or you mean some different place?

Rust bugs get tracked on GitHub: https://github.com/rust-lang/rust/issues

For the record: this has been reported by @cheblin as #65131.


And the cause has been found, and the fix is pending.

Thanks for your report, @cheblin!