3 ms·
The worst part is how easy it is to add derive and proc macros that kill compile times. I have a ~3k LOC project that blows up to over 45k LOC after `cargo expa
by akiselev 6y ago
The worst part is how easy it is to add derive and proc macros that kill compile times. I have a ~3k LOC project that blows up to over 45k LOC after `cargo expand` due to a dozen or so macros and the compile time is really starting to hurt iteration speed. Sadly, macros are by far one of my favorite Rust features.
I ended up paying for Clion just to get better debugger integration and a quick action for cargo expanding a file in the UI so I can copy paste the macro results into my codebase. I'm hoping that will improve incremental compilation times until I buy a Threadripper workstation.
- brundolf 6y agoDoes the expanded code take longer to compile than the equivalent handwritten code? Is it just the expansion itself that takes a long time? In the latter case, maybe cargo needs an intermediate macro-expansion cache (instead of just a crate-level build cache)
- TheCoelacanth 6y agoOften, you would write a lot less code if you were doing it by hand.
- mrlonglong 6y agoI adore CLion, it's brilliant for coding. At the moment I'm using it with Python and Git.