News for hackers. Stuff that matters.
Re:C++17 – better than you might think by fauigerzigerk on Thursday December 29, 2016 @06:00AM (#13276701)
There is one real problem with "modern" C++ that I would have hoped they would focus on: Compile times.

All the new stuff is heavily template based. As more libraries are written in that style, compile times go through the roof.

I wrote some code recently that required high precision monetary calculations. So I used boost multiprecision. It turned out to be completely impossible as most compilation units ended up depending on that library directly or indirectly.

Already slow compiles became unbearably slow. Facing a tight deadline I quickly wrote an extremely ugly, slow, error prone, pimpl based wrapper around boost multiprecision. Many calculations now require dynamic memory allocation for no good reason.

This is just terrible, because I know I can't leave it like this. I'm going to have redesign the whole thing or look for other libraries or look a lot more deeply into the calculations to see if they really cannot be done with large integers.

It's a productivity disaster. You could say I made wrong choices, which is true, but I think the C++ standards committee has been making wrong choices in not prioritizing a fix for compile times (modules?).

What's the point of having nice new features if you end up spending half your time on carefully cordoning off any code that uses them?

Re:C++17 – better than you might think by enqk on Thursday December 29, 2016 @07:26AM (#13276924)
I'm fighting with this daily. Working on a medium size desktop software application, seeing compile times increasing in the past months as developers use modernist C++.

Past a certain point, long compile times make it harder to improve a large code base. People work around it by adding more stuff at the leaves and never fixing fundamental parts of the code base, avoiding to touch heavily shared code. This is almost a guarantee for another increase in compile time (because you end up accreting more stuff) which makes it even harder to work on the code base at large scale.

And that has I believe a concrete effect on the quality of a piece of software.

The problem is, there are some low hanging fruits (like caching, parallelizing and distributing builds) so people think they can delay the inevitable. The problem is, those counter measures only deal with the average case, while doing nothing about the worst case.

Re:C++17 – better than you might think by mrich on Thursday December 29, 2016 @07:25AM (#13276921)
Modules are the answer, but it seems nobody cares enough to get them in the standard or, more likely, it's just too hard a problem.

Having looked at the clang modules implementation you basically have to clean up all the system includes, the standard library and your own headers before you can use them. And you will have to rewrite many things in these headers due to changed preprocessor semantics.

I think neither the clang nor MSVC implementations can be used for anything but the most trivial code due to these issues.

There are talks from Google who invested heavily into modules using clang and got gains, but as far as I understand they fixed those issues only for themselves.

More info welcome.

At this point the only cure is brute force (blades with many cores are not that expensive, or a distributed compile cluster) and always taking care with your includes.

Re:C++17 – better than you might think by Joky on Thursday December 29, 2016 @12:35PM (#13278639)
> Modules are the answer, but it seems nobody cares enough to get them in the standard or, more likely, it's just too hard a problem.

Aren't modules especially limited with the mentioned problem of templates? If I have a vector of a custom type, I still have to instantiate it in every file that is using this type, I don't think modules help much here, they reduce the amount of time parsing, not instantiating if I understand correctly.

We'll need to significantly change the way we handle templates in compilers to get significant improvement.

Re:C++17 – better than you might think by netheril96 on Thursday December 29, 2016 @08:01PM (#13281684)
Most of the time the same template with the same parameters are instantiated multiple times. If modules work, there should be only one compilation.
Re:C++17 – better than you might think by jimbokun on Thursday December 29, 2016 @10:49AM (#13277895)
"There are talks from Google who invested heavily into modules using clang and got gains, but as far as I understand they fixed those issues only for themselves"

I thought Google fixed the C++ compile time problem by inventing Go?

Re:C++17 – better than you might think by krona on Thursday December 29, 2016 @11:06AM (#13278033)
Inventing a new programming language is hardly sufficient if your existing codebase is 10M lines of c++ :).
Re:C++17 – better than you might think by haberman on Thursday December 29, 2016 @12:14PM (#13278485)
If we're talking about Google, I think the number is at least one order of magnitude larger. A year ago Google estimated it at 2 billion lines, though that appears to include all languages (not just C++): https://www.wired.com/2015/09/google-2-billion-lines-codeand...
Re:C++17 – better than you might think by lmm on Thursday December 29, 2016 @01:00PM (#13278810)
If the new language has good interop with C++ then it can be.
Re:C++17 – better than you might think by ori_b on Thursday December 29, 2016 @01:21PM (#13278944)
Good interop with C++ means parsing and instantiating templates. This means you have a C++ compiler.
Re:C++17 – better than you might think by usefulcat on Thursday December 29, 2016 @01:13PM (#13278900)
It doesn't help at all as soon as you need to do anything that requires compiling those 10M lines of legacy code (think bug fixes, for example).
Re:C++17 – better than you might think by user5994461 on Thursday December 29, 2016 @01:55PM (#13279176)
No language has good interop with C++.
Re:C++17 – better than you might think by OlaOst on Thursday December 29, 2016 @06:38PM (#13281203)
The D language, while not 100% C++ compatible, takes a pragmatic approach to C++ interop (https://dlang.org/spec/cpp_interface.html)
Re:C++17 – better than you might think by the_why_of_y on Saturday December 31, 2016 @04:49PM (#13293360)
Not even C++ has good interop with C++, given how underspecified it is. Is that library built with MinGW or with Visual Studio?
Re:C++17 – better than you might think by vvanders on Thursday December 29, 2016 @01:08PM (#13278861)
Last I looked at Go is was missing pinning and few other things that are necessary for interacting with native code.
Re:C++17 – better than you might think by agentgt on Thursday December 29, 2016 @12:08PM (#13278448)
No they invented their own build system and tools (Bazel). Although some of the tools are open source the true distributed compile scaling stuff I think is still not.
Re:C++17 – better than you might think by paulddraper on Thursday December 29, 2016 @03:42PM (#13279954)
No, they invented Blaze (general purpose caching build tool, open-sourced as Bazel).

Go is hardly a replacement for C++. Garbage collection, no templates, no const, etc.

Re:C++17 – better than you might think by pjmlp on Thursday December 29, 2016 @08:05AM (#13277040)
Modules are on the good track, looking from the latest CppCon and LLVM talks,they have progressed a lot on their internal use.

I am confident that by C++20 they will be available.

The main problem will be the adoption by major libraries.

Re:C++17 – better than you might think by mrich on Thursday December 29, 2016 @08:12AM (#13277064)
Correct me if I'm wrong, won't we need an updated OS tool chain, i.e. kernel headers and libc/libstdc++ fully adjusted? That will take some work...
Re:C++17 – better than you might think by gpderetta on Thursday December 29, 2016 @10:39AM (#13277831)
Libstdc++ is normally distributed with the compiler, so it will be updated as required by the standard.

Regarding the libc and other headers, modules will still fullly support include files, so that won't be an issue. You should be able to include headers and export them as modules.

Re:C++17 – better than you might think by dom0 on Thursday December 29, 2016 @11:40AM (#13278266)
Kernel/system headers are C, or part of a compiler SDK.

libc and libstdc++ are part of the compiler runtime, ie. will be updated together with it.

Re:C++17 – better than you might think by pjmlp on Thursday December 29, 2016 @09:36AM (#13277445)
Just kind of.

Kernel headers are only an issue on free UNIX like OSes, on other OS what matters is what the SDK provides.

So at least in what concerns Apple, Google, Microsoft and every other commercial vendor OSes, don't expect a big issue having their SDKs updated when they start supporting modules.

The problem is getting the BSD, Linux and open source libraries without a specific agenda to adopt them.

Re:C++17 – better than you might think by cypher543 on Thursday December 29, 2016 @02:43PM (#13279496)
Clang uses "module maps" to turn existing header-based libraries into modules. So, theoretically, your system compiler could include a module map for all of the system headers. I don't know if module maps are going to be part of the standard, though.
Re:C++17 – better than you might think by babuskov on Thursday December 29, 2016 @10:52AM (#13277918)
> There is one real problem with "modern" C++ that I would have hoped they would focus on: Compile times.

I found a really simple solution to this: disable all optimizations while you are developing and only use them for production build. I have 70k LOC project that compiles from scratch in 10-11 seconds (using 8 parallel builds).

Regular changes to 2-3 .cpp files and link are done in 1-2 seconds.

This is esp. important with MSVC which has a huge difference between non-optimized and optimized build.

Also, use precompiled headers.

Re:C++17 – better than you might think by RBO2 on Thursday December 29, 2016 @12:08PM (#13278446)
Also I use ccache on all my projects. Rebuilds times are now at 10s for a 50 kloc project.
Re:C++17 – better than you might think by mikepurvis on Thursday December 29, 2016 @02:49PM (#13279551)
Sure, but in a "modern" codebase where you're template-everything, then more changes will be in headers, resulting in a lot more translation units being affected by any given change.
Re:C++17 – better than you might think by user5994461 on Thursday December 29, 2016 @01:56PM (#13279182)
There are issues which may arise because of the optimizations. Need to have them in a staging build.
Re:C++17 – better than you might think by Arnsaste on Thursday December 29, 2016 @07:48AM (#13276972)
I agree, the compile times are my mine problem with C++ right now, and they are not getting better.

If you listen to the C++ advocates, they all say use the STL as much as possible, use boost if there is solution for your problem there, etc.. It's true, you probably will quickly get a solution that works and looks pretty, but if you do this a hundred or a thousand times your code suddenly needs several hours to compile.

I am not against the STL, or boost, but there is a cost associated with using them that is often ignored, but IMHO is actually a productivity killer in codebases that are a bit bigger.

Re:C++17 – better than you might think by xyzzy_plugh on Thursday December 29, 2016 @01:39PM (#13279089)
Boost is always my last resort.

While Boost often implements the latest proposed standards and provides a vast extension to the STL, it is not the STL. Often proposed standards changes are best implemented by changing the compiler itself. Expecting Boost to provide the same functionality as a modified compiler without a cost is foolish.

Boost provides great implementations but at a great cost in complexity, compile time and binary size bloat. I don't even really believe modules will solve this. They push the boundaries of what is possible with today's equipment, in order to discover what the next equipment should be.

Also I no longer look to Boost libraries as a Seal of Quality. There be dragons. Choose wisely.

Re:C++17 – better than you might think by jzwinck on Thursday December 29, 2016 @06:45AM (#13276815)
To speed up parallel compilation, use icecc. It's great if you half even two or three computers on your LAN.

For high precision currency, use int64_t (perhaps in a simple POD class). This, with an 8-digit implied decimal part, is enough to represent the finest price unit in any market today, with a max of 92 billion.

If you are dealing with more than 92 billion of any currency in a single place, don't complain!

Re:C++17 – better than you might think by pavlov on Thursday December 29, 2016 @07:33AM (#13276940)
After years of hyperinflation, Zimbabwe's currency was entirely discarded last year. The final exchange rate was 35 x 10^15 Zimbabwean dollars for one USD:

"Bank accounts with balances of up to 175 quadrillion Zimbabwean dollars will be paid $5. Those with balances above 175 quadrillion dollars will be paid at an exchange rate of $1 for 35 quadrillion Zimbabwean dollars.

"The highest – and last – banknote to be printed by the bank in 2008 was 100 trillion Zimbabwean dollars. It was not enough to ride a public bus to work for a week."

https://www.theguardian.com/world/2015/jun/12/zimbabwe-offer...

Re:C++17 – better than you might think by kabdib on Thursday December 29, 2016 @09:43AM (#13277476)
I guess you could move the decimal point a bit and just add zeroes on output for that particular currency. [Not serious, this is a strong argument for int128 for currency... wow]

Gas stations in the US had a similar problem in the 1970s; most pumps didn't go over 99 cents a gallon. Took a few years for things to be retrofitted.

Re:C++17 – better than you might think by geezerjay on Thursday December 29, 2016 @10:29AM (#13277761)
A better idea would be to use a surrogate currency, like a tera- or peta-Zimbabwean dollar, which had a exchange rate of about 1:10^12 or 1:10^15.

I'm sure no one dealing with zimbabwean currency would care for so many significant digits.

Re:C++17 – better than you might think by tcbawo on Thursday December 29, 2016 @12:08PM (#13278451)
A large swath of the finance industry (especially trading) is concerned with optimal speed, not outlier edge cases. They would rather ignore pathological cases like the Zimbabwean currency than sacrifice performance.
Re:C++17 – better than you might think by smitherfield on Thursday December 29, 2016 @10:58PM (#13282400)
There are more commonly-traded currencies, such as the Russian ruble and the old Brazilian cruzeiro, that have had hyperinflation in the recent past.

But you certainly could have a fast path for stable currencies that are very unlikely to hyperinflate (USD, EUR, GBP, JPY).

Re:C++17 – better than you might think by user5994461 on Thursday December 29, 2016 @02:03PM (#13279229)
Disagree with that. Overflows and rounding errors are not to be taken lightly.
Re:C++17 – better than you might think by tcbawo on Thursday December 29, 2016 @04:10PM (#13280158)
Of course overflow and rounding error must be accounted for in your data type. Exchanges have price boundaries, price quanta, or risk boundaries that would guide this decision. My point is that you would not rule out a data type for trading based on an obscure currency like the Zimbabwean dollar.
Re:C++17 – better than you might think by mingodad on Thursday December 29, 2016 @08:29AM (#13277128)
If you can uses gcc you can use _Decimal64 or _Decimal128, I have a sqlite3 fork that uses it for currency precision calculations. https://github.com/mingodad/sqlite
Re:C++17 – better than you might think by cm2187 on Thursday December 29, 2016 @07:10AM (#13276868)
In JPY you get there very fast.

Even in EUR/USD/GBP, a typical large bank balance sheet is over a trillon.

Re:C++17 – better than you might think by fauigerzigerk on Thursday December 29, 2016 @07:36AM (#13276949)
True. Also, the smallest unit in which prices are quoted is not in all cases sufficient for calculations. A million + 1 rounding errors after the 8th decimal place adds up to an error measured in cents.

In my particular case, 64 bit integers might be sufficient. I thought about it but then decided I wanted to be on the safe side. Maybe not the best decision.

Re:C++17 – better than you might think by cm2187 on Thursday December 29, 2016 @07:44AM (#13276964)
Not sure what sort of assets you are looking at but prices are rarely quoted with a very large number of decimals. Having chunky increments is sort of necessary to match bid and offers on markets.
Re:C++17 – better than you might think by fauigerzigerk on Thursday December 29, 2016 @08:15AM (#13277080)
Sure, but division and multiplication add more decimal places. If you do a lot of calculations and you truncate or round every single intermediate result, rounding errors may add up to unacceptable levels in some cases.

So I wanted perform the caculations with high precision, then round the final result according to what the law requires.

Re:C++17 – better than you might think by twic on Thursday December 29, 2016 @08:38AM (#13277164)
Last time i did calculations in high finance, we used a (buggy, handrolled) 128-bit fixed-point type for exactly this reason.
Re:C++17 – better than you might think by poikniok on Thursday December 29, 2016 @09:42AM (#13277468)
Thankfully there is __int128 these days natively!
Re:C++17 – better than you might think by twic on Thursday December 29, 2016 @01:30PM (#13279009)
Not in Java, sadly!
Re:C++17 – better than you might think by lmm on Thursday December 29, 2016 @08:45AM (#13277192)
> Having chunky increments is sort of necessary to match bid and offers on markets.

How so? If there's a resting offer at 11.58726 and I put in a buy order, limit 11.63492, there's no reason an exchange can't match that and execute either at the midpoint or at 11.58726 +/- maker/taker (whichever the exchange policy is). What's the problem?

Re:C++17 – better than you might think by cm2187 on Thursday December 29, 2016 @09:53AM (#13277535)
I'm not an expert on exchanges but my understanding is that the transaction is executed if the two sides of the order book match or the bid exceeds the ask. If you allow for a very large number of digits in the price, you reduce the probability there will be a match because of a tiny difference between the bid and ask. Won't be a problem on the most liquid securities but more of a problem on less liquid ones.

My understanding is that all prices on exchanges have a fixed number of decimal (and sometimes are even based on less granular base, like 1/8th of a decimal).

Re:C++17 – better than you might think by lmm on Thursday December 29, 2016 @10:25AM (#13277730)
If the bid exceeds the ask there will be a trade; if not, the order will rest on the book. That's entirely normal, and a smoothly-functioning exchange should allow granular enough pricing that there would be a clear spread - when the spread is the minimum increment possible (as it usually is in equities markets - the offer is almost always just $.01 above the spread) that is a sign that there are trades that could be executing but aren't (e.g. if the bid is at 5.23 and the offer at 5.24, maybe both parties would be willing to trade at 5.233).

There's an argument that more granular prices make it harder for humans to read the order book but I don't put much faith in it.

Re:C++17 – better than you might think by melling on Thursday December 29, 2016 @06:38AM (#13276799)
Modules are suppose to help with compile times. They never seem to make it into the standard. Must be a few outstanding complications.
Re:C++17 – better than you might think by koja86 on Thursday December 29, 2016 @06:47AM (#13276824)
There are others who feel like us. Fingers crossed:

http://clang.llvm.org/docs/Modules.html#problems-with-the-cu...

Re:C++17 – better than you might think by prefect42 on Thursday December 29, 2016 @09:04AM (#13277290)
In Microsoft-Land, I find that every time we force ourselves to upgrade to the latest compiler (really entire IDE, Visual Studio) then everyone also needs to upgrade their machines. Both the IDE and the C++ compiler run dog slow on "older hardware". We're talking new-ish microarchitecture, faster RAM, and SSDs, to keep things sane. This is just one anecdotal use case of course.

Though I'm curious as to what you mean by "unbearably slow", and what your toolchain is.

Re:C++17 – better than you might think by mrich on Thursday December 29, 2016 @09:23AM (#13277388)
I have found the latest update (VS 2015), were Microsoft significantly invested in the compiler after years of stagnation, to bring better compile speed in addition to standards support. There were also quite some bugs in the codegen, but it seems those are never avoided when working on a C++ compiler.

I find the IDE to still be sufficiently fast after disabling some things like Git integration and codelens.

Re:C++17 – better than you might think by tomohawk on Thursday December 29, 2016 @08:24AM (#13277111)
This is one of the pain points that caused Google to develop golang.
Re:C++17 – better than you might think by DrBazza on Friday December 30, 2016 @06:14PM (#13288349)
There are various solutions to compile times in C++ that have been talked about at length over the years. Lakos' book from 1996 talks about this.

In fact, a lot of modern software engineering guidelines come from working around C++'s built in shortcomings.

Use things such as the Pimpl idiom to help linking. Modular libraries rather than big-ball-of-mud, do you really need to recompile world+dog each time? Top-down includes, and no relative includes, isolating your code. In fact go-lang does exactly this.

The trouble is that in C++, fast compile times need to be designed into the code base and often enforced by scripts. I don't think that there's any other language that requires so much 'non-language' engineering as C++.

Re:C++17 – better than you might think by digler999 on Thursday December 29, 2016 @04:38PM (#13280366)
> Already slow compiles became unbearably slow.

what is unbearably slow ? an hour ? a day ? how many times did you actually have to rebuild the entire code base ? Did you do parallel builds, or see what gains you could get from faster hardware ?

I'm genuinely curious as I've never worked on a codebase that large, and the only time you have to rebuild everything is when someone changes a common library header.

Re:C++17 – better than you might think by gigatexal on Thursday December 29, 2016 @11:08AM (#13278049)
What about things like incredibuild? https://www.incredibuild.com/incredibuild-product-overview.h...

I'm not paid to use them or shill for them I just think distributed compilation might help

Re:C++17 – better than you might think by enqk on Thursday December 29, 2016 @11:44AM (#13278291)
If you want to plug this one, you can plug and have a look at a open source, very easy to use alternative called FASTbuild: http://fastbuild.org
Re:C++17 – better than you might think by logicallee on Thursday December 29, 2016 @07:49AM (#13276981)
holy cow, I never would have thought in 2016 compiling a C++ program could be so slow that it makes it impossible for someone.

Can you put numbers on these figures? By "Unbearably slow" how many minutes (or hours) did you mean? Do you use a heavy desktop with a fast SSD and a lot of RAM?

Finally what is the total output program size (roughly). Like are we talking about an application that is in the gigabytes, like the complete Adobe suite or something?

I would like to know more information about how it's possible for this to happen. tell us as much as possible :)

Thanks!

Re:C++17 – better than you might think by dibanez on Thursday December 29, 2016 @09:51AM (#13277519)
As others have mentioned, I've resorted to brute force (parallel compile using 16 physical cores, good SSD, 32GB RAM). I have a 20KLOC library that I wrote myself (very few templates), that takes 20 sec to compile in parallel, meaning in serial it would take about 5 min. Then there is a giant 3MLOC system I work with (much templating), that takes 20 min to compile in parallel (consuming 15GB RAM), meaning in serial it would take 6 hours. One can also see in this 3MLOC system that it is the last few small files that take the longest to compile, because they include much of the rest of the system as template code in headers.
Re:C++17 – better than you might think by thechao on Thursday December 29, 2016 @11:36AM (#13278241)
Preprocess your source 'cat' the results together; then, hand off to the compiler. On a 2015 MacBookPro I've seen upwards of 100kloc/s. Probably average 30--60kloc/s. With ccache my 5mloc code base takes as little as 300ms to do incremental compile & relink.

Another thing is to rely on the preprocessor for code generation; then you're dealing with memory-speed elaboration of the AST, rather than reading off of disk.

Re:C++17 – better than you might think by dibanez on Thursday December 29, 2016 @01:31PM (#13279020)
I did the single file trick for the small library that I control, as a configure option. It definitely does help, 2X speedup in serial compile time typically. however, you lose the ability to compile in parallel, which with my hardware gives a 16X speedup, so for now parallel compiles are the winner.
Re:C++17 – better than you might think by Joky on Thursday December 29, 2016 @01:14PM (#13278905)
Something smells with the structure of the project if a small change in a single file triggers a long rebuild. Including headers that define template should be "free", it is costly when you start instantiating all of them. There might be opportunity to restructure some part. Also precompiled-header or better: modules can help (not much with template instantiation though).
Re:C++17 – better than you might think by dibanez on Thursday December 29, 2016 @01:37PM (#13279066)
In my parent comment are listed compile times from scratch, although there probably exist one or two files that would trigger similarly long rebuilds (included indirectly by most other files). If you change a random line of code, chances are the rebuild is quite limited. As others commented above, this actually scares people away from improving the core files.
Re:C++17 – better than you might think by deong on Thursday December 29, 2016 @10:05AM (#13277606)
So the major component of a modern C++ application that contributes to long compile times is templates.

In C and "older" C++, you're probably used to doing a particular style of separate compilation. You put your prototypes in header files, your implementations in cpp files, do the equivalent of `gcc -o somefile.o somefile.cpp` for every cpp file in your project. Each of those separate compilation stages has to include any referenced headers, but then it just compiles the code in that cpp file and writes an object file. At the end, you do one more step to link all the object files into a binary executable. This is fast and as parallelizable as the number of files you have.

In C++ today, you're likely doing a lot with templates, and templates don't work this way. With templates, every compilation unit that references a template needs not just declarations from a header file -- it needs the complete source code for that template. You essentially have to #include the cpp files (through one mechanism or another).

Simplifying a bit, that means that if you have a template defined in one file that is used by code in 25 other files, that template gets compiled 25 different times, and worse, you lose out on a lot of parallelism because by the time the compiler sees the code, the preprocessor has expanded the templates into one giant compilation unit that's going to be (slowly) compiled on one core.

I just grabbed the code I wrote during my PhD thesis that was heavily template-based. It's tiny (about 15,000 lines of C++) and building it on this $3000 2015 Macbook Pro took about a minute, and clang++ used a bit over 800 MB of memory in the process. (https://github.com/deong/sls if anyone cares to see the example).

You certainly don't have to be building the Adobe suite to see compile times in the tens of minutes, and even moderate sized applications can put you into the hours. So much just depends on how the application is structured and written as opposed to only looking at size.

Re:C++17 – better than you might think by fauigerzigerk on Thursday December 29, 2016 @09:40AM (#13277457)
I can't put numbers on it as the codebase no longer exists in that form, but I can tell you what I consider "unbearably slow".

"Unbearably slow" is when the compiler takes too long for me to stay focused on a single task. So compile times in the minutes are a blow to my productivity.

The machine is i7, 4 cores, 8G RAM, SSD. Definitely not as beefy as it should be.

But my point isn't about how to optimize C++ compile times by adding more hardware. It's about the relative impact of "modern" C++ compared to traditional C++. There shouldn't be a disincentive to using modern libraries.

Re:C++17 – better than you might think by logicallee on Thursday December 29, 2016 @12:07PM (#13278439)
Thanks!
Re:C++17 – better than you might think by lmm on Thursday December 29, 2016 @08:49AM (#13277208)
I dug out some 5-year-old C++ code recently, about 20kloc. I was expecting it would compile instantly on modern hardware like my Surface Book. It's taking about 12 minutes to build on travis with some of the worst offenders disabled (the SWIG-generated bindings were particularly slow IIRC), and a local build feels like it takes longer: https://travis-ci.org/PembrokeNS/sakusen
Re:C++17 – better than you might think by quinnftw on Thursday December 29, 2016 @08:00AM (#13277019)
To piggy back on this comment: what build system are you using? I've found that bazel has greatly reduced compile times, even when using boost and opencv.
Re:C++17 – better than you might think by dom0 on Thursday December 29, 2016 @11:47AM (#13278308)
I have used qbs with great success. It's by far the fastest and most correct¹ build system for C++ that I've used so far, and it's configuration ain't so bad (tm).

¹ I used it in a couple projects and never had a single incorrect build. With most other build tools, be it CMake or Gradle, these happen regularly for me.

Re:C++17 – better than you might think by jlewallen on Thursday December 29, 2016 @09:38AM (#13277454)
I just took a very quick look at Bazel and saw that Windows support is "Highly Experimental" which concerned me. I've been looking around in this space recently as I'm getting into C/C++ again (ARM uC stuff) and all three platforms are fairly important to me for what I'm doing. I'm a big Gradle fan and Bazel seems like a natural next step if it's not problematic.
Re:C++17 – better than you might think by quinnftw on Friday December 30, 2016 @09:46AM (#13284579)
I develop solely in UNIX environments so I can't comment on its performance on windows, but it's fantastic on UNIX and very easy to write / configure.
Re:C++17 – better than you might think by xgdgsc on Thursday December 29, 2016 @10:56AM (#13277958)
Have you tried using precompiled headers? I' ve started using it recently and want to here some user stories.
Re:C++17 – better than you might think by Const-me on Thursday December 29, 2016 @12:38PM (#13278662)
In Microsoft world, they are available for a couple decades. Yes, they help a lot with compilation time.
Re:C++17 – better than you might think by my123 on Thursday December 29, 2016 @07:15AM (#13276892)
And existing compilers that do not support them and that you still have to support...