InterviewSolution
| 1. |
How To Reduce Compilation Time Of Programs Using Cgal? |
|
Answer» CGAL is heavily USING C++ templates, and this has an impact on compilation speed. Here are some hints that can help speed up compilation of programs using CGAL:
Regroup translation units: If your program is composed of many small translation units to be COMPILED and linked, try to reduce their numbers by merging them. This traditional style for C programs is actually very slow for programs heavily using C++ templates. Regrouping them reduces the time spent by the compiler to parse the header files, and avoids redundant template instantiations. Precompiled header files: Some compilers, such as GCC, provide a feature named precompiled headers. This can be mostly useful if you can regroup in a single header file most of the header files that you use, together with most template instantiations. CGAL is heavily using C++ templates, and this has an impact on compilation speed. Here are some hints that can help speed up compilation of programs using CGAL: Regroup translation units: If your program is composed of many small translation units to be compiled and linked, try to reduce their numbers by merging them. This traditional style for C programs is actually very slow for programs heavily using C++ templates. Regrouping them reduces the time spent by the compiler to parse the header files, and avoids redundant template instantiations. Precompiled header files: Some compilers, such as GCC, provide a feature named precompiled headers. This can be mostly useful if you can regroup in a single header file most of the header files that you use, together with most template instantiations. |
|