News for hackers. Stuff that matters.
Re:Is C++ fast? by lasagnaphil on Friday January 18, 2019 @10:13AM (#18939809)
I would say C++ is more like a zero runtime-cost abstraction language (in release builds).

You could achieve good release build runtime-speeds in modern idiomatic C++, but you have to trade off your compile times and Debug-build runtime-speeds for that.

Re:Is C++ fast? by vardump on Friday January 18, 2019 @11:08AM (#18940236)
> I would say C++ is more like a zero runtime-cost abstraction language (in release builds).

Well, other than the "zero-cost" features that increase code size. For example careless use of heavy template classes can generate a lot of code.

In other words, in C++ it's very easy to generate a lot of code from seemingly innocent constructs.

Instruction cache misses, page faults (and to lesser amount TLB misses) are not zero cost.

Re:Is C++ fast? by ben509 on Friday January 18, 2019 @12:31PM (#18940980)
To your point, cost (or strength) should always consider size as well as time.

It would be nice to have a tool that could compute the size impact of a given line.