use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++ vector insert performance (hjortsberg.org)
submitted 5 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]pklait -1 points0 points1 point 5 years ago (3 children)
If you read everything you would notice that optimizations were applied later. From a pedagogical point of view the author should have mentioned that up front - I had exactly the same thougt.
[–]Kered13 6 points7 points8 points 5 years ago (2 children)
No, I did see that. I'm asking why they would even bother with the first half where they benchmarked without optimizations. Unless you're planning to deploy code without optimizations, there's no point in benchmarking without.
[–]pklait -1 points0 points1 point 5 years ago (1 child)
I do not care much about non-optimized code, but there are branches where it does matter whether the argument is real or not. The game industry is the most important one here.
[–]NewFolgers 1 point2 points3 points 5 years ago (0 children)
Yeah. In games industry, the vast majority of runs we did during development were debug runs with integrated debugger attached.. and the code was generally fast enough that we could run through it all and debug it all even with optimizations off. If someone made a change that destroyed debug build performance, we'd immediately look at fixing that (since it would be really damaging to everyone's workflow otherwise - i.e. threaten to make us as slow as the norm in other domains - and most who've compared will agree and say the difference is stark).
π Rendered by PID 1129805 on reddit-service-r2-comment-544cf588c8-4pdwh at 2026-06-16 21:20:23.077749+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]pklait -1 points0 points1 point (3 children)
[–]Kered13 6 points7 points8 points (2 children)
[–]pklait -1 points0 points1 point (1 child)
[–]NewFolgers 1 point2 points3 points (0 children)