Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"the sad state of debug performance in c++" by Vittorio Romeo

25 views
Skip to first unread message

Lynn McGuire

unread,
Sep 27, 2022, 6:12:28 PM9/27/22
to
"the sad state of debug performance in c++" by Vittorio Romeo
https://vittorioromeo.info/index/blog/debug_performance_cpp.html

"By now, it should (hopefully) be common knowledge that the term “zero
cost abstraction” is a lie. To be fair, it’s more of a misnomer – had
the term been “abstraction likely to result in zero runtime overhead
after optimizations” then it would have been much more honest, but I can
see why that didn’t fly…"

"Most C++ developers tend to accept the fact that “zero cost
abstractions” provide zero runtime overhead only with optimizations
enabled, and that they have a negative impact on compilation speed. The
same developers tend to believe that the benefits of such abstractions
are so valuable that having your program perform poorly in debug mode
(i.e. without optimizations enabled) and compile more slowly is worth it."

"I used to be one of them."

He is not wrong.

Lynn


Manfred

unread,
Sep 27, 2022, 11:40:46 PM9/27/22
to
The point still stands.
The author's assumption is that debug mode == no optimizations. That's
not the case.


Juha Nieminen

unread,
Sep 28, 2022, 1:45:16 AM9/28/22
to
Lynn McGuire <lynnmc...@gmail.com> wrote:
> "the sad state of debug performance in c++" by Vittorio Romeo
> https://vittorioromeo.info/index/blog/debug_performance_cpp.html
>
> "By now, it should (hopefully) be common knowledge that the term ???zero
> cost abstraction??? is a lie. To be fair, it???s more of a misnomer ??? had
> the term been ???abstraction likely to result in zero runtime overhead
> after optimizations??? then it would have been much more honest, but I can
> see why that didn???t fly???"
>
> "Most C++ developers tend to accept the fact that ???zero cost
> abstractions??? provide zero runtime overhead only with optimizations
> enabled, and that they have a negative impact on compilation speed. The
> same developers tend to believe that the benefits of such abstractions
> are so valuable that having your program perform poorly in debug mode
> (i.e. without optimizations enabled) and compile more slowly is worth it."
>
> "I used to be one of them."

"When I don't use compiler optimizations the program is slower."

Well, duh. What exactly is he expecting?

(And as has been pointed out, debugging and optimizations are not a
mutually exclusive thing. Nothing stops you from specifying optimization
flags *and* debugging flags at the same time.)

Mr Flibble

unread,
Sep 28, 2022, 12:22:52 PM9/28/22
to
He is wrong, and so are you.

/Flibble


0 new messages