3 ms·
"Modules are often talked about as a way to speed up compilation." How much do modules help compilation speed? This was supposedly one of the reasons Go compi
by melling 11y ago
"Modules are often talked about as a way to speed up compilation."
How much do modules help compilation speed? This was supposedly one of the reasons Go compiles fast. Swift has modules but I don't believe that it has fast compilation.
- netheril96 11y agoFor C++, the major speed improvement of modules would probably come with not having to parse a giant header (after preprocessing) again and again and again and again. That is not a problem ever in other languages, so comparison may be meaningless.
- adrusi 11y agoI'll echo netheril96, but it's perhaps worth mentioning that for very large projects, especially if they are likely to be compiled on a weak machine, it can reduce compilation times by limiting the size of the symbol table.
- cageface 11y agoSwift 2 compiles much faster than Swift 1. I'm not sure I'd call it "fast" yet, but I no longer have time for a coffee break when doing a complete rebuild of a reasonably large project.
- DannyBee 11y agofor large projects, they help a lot. I've seen large projects whose compile time has gone from 3 minutes to 10 seconds.
- xenadu02 11y agoThose of us on Apple platforms have been using modules for a while now. They help a ton because an imported module has a pre-baked interface, not a huge set of header files that get copied and pasted (from the compiler's point of view). You cant break the module's header with a funky macro either.