c++ - Compiler memory consumption with template libraries (boost + Eigen) -
i writing template algorithm makes use of boost::accumulators , eigen linear algebra library. while compiling, visual studio compiler (cl.exe), memory consumption peaks @ on 2.5gb of ram, , pc (windows 7 32 bit 3gb virtual address space) becomes unresponsive (for quite long time: ~1 minute). binary files (.obj) 10-20mb these compilation units.
my questions (not directed towards these specific libraries)
- is normal behavior code heavily uses templates?
- is there can done reduce memory demands , compile time?
- if there no solution problem, why isn't addressed people design programming language? more people understand c++, more use templates, , generate hard-to compile code, , bloated binaries.
if there no solution problem, why isn't addressed people design programming language?
because there no solution, full stop.
the problem talking has nothing c++. it's artefact c- old "translation unit". fixing problem require re-doing compilation model. c++ committee has been trying years make happen without breaking every single line of existing c++ out there (which bigger consideration), it's not trivial problem. fixing require vast changes.
also, clang has way better performance, , newer versions of gcc variadic-template-equipped can well.
Comments
Post a Comment