Remix.run Logo
levodelellis 3 hours ago

I measured once and to my surprise templates aren't (directly) the reason for long compile times. It's function bodies in headers, and obviously templates are in headers and they call other templated functions/classes which explodes code generation and time. But if it's only a few lines and doesn't call other templated functions it's likely fine. I wrote about it here https://bolinlang.com/wheres-my-compile-time

After writing that, I wrote my own standard library (it has data structs like vector, hashmap and sets; slices, strings, rng, print, some io functions, and more) which uses a lot of templates, and it compiles in <200ms on both clang and gcc. Many standard library headers take much longer to compile than that. It's not a terrible idea to have your own standard lib if you need quick compile times.

rustyhancock an hour ago | parent | next [-]

Another option can be if you have a core set of headers your project will use (and is stable) just precompiling them.

direwolf20 2 hours ago | parent | prev [-]

Your website seems to be blocking Tor