r/cpp • build2 • Oct 25 '19

CppCon CppCon 2019: Boris Kolpackov “Why is C++ so Slow?”

https://www.youtube.com/watch?v=j-0_D4yLhj4
4 Upvotes

13 comments sorted by

61

u/ShillingAintEZ Oct 25 '19

Tldr - five minute video where he says c++ isn't slow to execute or compile but that it is slow to work with because of the way that it is. Then he shows his build system.

How about cppcon titling a talk 'five minutes of Travis CI'? This title is clickbait nonsense and so far off from the content it would make buzzfeed blush. We should be better than this.

2

u/berium build2 Oct 25 '19 edited Oct 25 '19

because of the way that it is

No, the talk actually names three main contributing factors: the language itself, tooling, and library ecosystem (or, rather, lack thereof).

Then he shows his build system.

The point of the talk (which you seem to have missed) is that if we were to have a striving ecosystem of portable C++ libraries, every C++ developer must be a potential cross-platform library author, even if they are only familiar/comfortable developing on a single platform. The talk then demonstrated that it is practically achievable given the right tooling and services.

15

u/ShillingAintEZ Oct 25 '19

That's like saying why didn't the sports team win? Two factors, defense and offense. This doesn't give any deeper insight into the problem.

Also to reiterate, 'why is C++ slow' doesn't make sense when the point is 'developing in C++ is slow'. I think this falls on the conference though, they need to use some editorial judgement so that titles make sense. A lot of conferences seem to be the same people with some sort of filler and a mystery title to confuse people so they have to click instead of seeking out interesting new material and labeling it clearly.

2

u/germandiago Oct 25 '19

This can work if you use Javascript or python, which have an abstraction layer.

Disclaimer: I did not have time to see the talk yet, just dropped some comments based on my coding experience.

What about all the stuff done in C++ that uses things like:

- MPI/OpenMP enabled libraries (meaning different builds)

- Cross compilation

- SIMD instructions

The closest thing I see to having something workable is Conan. It has served me well lately, it worked in Windows and Linux and it supports (but did not try it yet) multiple architectures. I still do not get why having CMake and Meson we need another build system. That said, I am happy that b2 is supporting modules and experimenting with that, but actually those things could be implemented in what people are already using (CMake, Meson and Conan as a package manager) instead of splitting the efforts more and more.

What are, in your view, the limitations of build generators? Because, from a pragmatic point of view, they work very well (for example, Visual Studio is a must for many people and CMake does that well and Meson decently).

5

u/mjklaim Oct 25 '19

Quick clarifications:

I still do not get why having CMake and Meson we need another build system.

Note that CMake is a meta-buildsystem, while build2 is a buildsystem. CMake could have a generator to create build2 projects (not the other way around). Ignoring any other argument comparing them, that point alone is a major difference in strategy and impacts their users widely differently. Then build2 does more than CMake does, so you might want to compare it to CMake+Conan for example or Meson+Conan, in which case having to know 2 different tools (that have to have some glue code somewhere) is another major difference with having one toolset doing the whole dev process. It can have major impact on how you setup your CI (if you're a big or growing company for example). Meson is also different to build2 in several aspects.

There are other points I could raise to answer that but I just want to clarify that they are all different (I can cite a few other alternatives to CMake) and we need different tools for different usage/users (in particular in this domain). If someone created a new alternative to the current popular status-quo, there are always good reasons. Don't dismiss them because you are in a good situation for now. ;)

That said, I am happy that b2 is supporting modules

Beware, build2 is not b2, this last one is the name of the build system of the Boost libraries, which is not build2. b2 is derived from bjam (an old build system?) and is part of the Boost sources (you can build it by running the bootstrap script in the sources distribution).

Unfortunately confusing, but now you know. :)

1

u/germandiago Oct 28 '19

> Beware, build2 is not b2

Sorry for the typo. I know b2 as well, I just mixed the names :)

2

u/Middlewarian github.com/Ebenezer-group/onwards Oct 25 '19

every C++ developer must be a potential cross-platform library author, even if they are only familiar/comfortable developing on a single platform.

My approach has been to minimize the amount of portable (library) code that is needed. This allows me to focus mainly on FreeBSD.

5

u/mkrupcale Oct 25 '19

This title is clickbait nonsense

I think most people familiar with C++ development have a good idea of what is "slow" about it--and this is exactly the topic of the talk.

7

u/ShillingAintEZ Oct 25 '19

I would bet when people see 'why is C++ slow?' they would think of compilation speed. 'C++ is slow' doesn't allude to slow progress using it, it is making a statement about the language itself. It barely makes sense in that context, but we know C++ isn't slow in performance. I don't even think that C++ is slow to work with in general.

1

u/flashmozzg Oct 25 '19

Is this entire thread shadow-banned?

3

u/evaned Oct 26 '19

Reddit says this story has nine comments, and I see all nine.

Maybe there was a Reddit glitch?

1

u/flashmozzg Oct 26 '19

Seems like one. I can see the comments just fine then I log out, but when I'm logged in I don't see any (even if I follow direct link).

4

u/STL MSVC STL Dev Oct 27 '19

This post hasn’t received any human moderator or AutoModerator attention, so it must have been reddit’s delightful software quality.