Matthias
Matthias

Reputation: 101

Excessive compile time with boost::xpressive on Mac OS 10.6

we are using boost::xpressive for working with regular expressions in an C++/ObjC application. Since the update to Mac OS 10.6 we found that the compilation times are extremely long (1-2 mins for each file (!) on a Dual-Quad MacPro...) where the expressions are defined and compiled via sregex::compile(). In addition, the whole system's performance slows down resulting in irresponsive applications; for all other files compilation runs as expected.

The compiler used is gcc4.2, both on 10.5 and 10.6. Do you have similar experiences and/or suggestions? Is there a way to prevent this using PCHs?

Thanks and regards
Matthias

Upvotes: 2

Views: 481

Answers (1)

Christoph
Christoph

Reputation: 21

Using templated templates (which is what boost is all about (ok, not only that, but a lot of it)) is quite slow in many compilers. This causes bad compilation times for Boost.Spirit, Boost.Expressive and others. Known issue, regular topic on the Boost mailing lists.

You can

  • read the docs and hope for hints (some Boost Libs do have such things documented)
  • maybe Boost.Regex has better compile times
  • make sure you use such things in .cpp files only - if you use that stuff inside headers your compile times will suffer in "unrelated" files
  • separate Boost.Expressive code into a separate .cpp file
  • hope for the next g++ version to better handle templated code

Upvotes: 1

Related Questions