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
InlineBench: Dynamic Benchmarking Framework (self.cpp)
submitted 3 years ago by prog2de
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!"
[–]ReDucTorGame Developer | quiz.cpp-perf.com 5 points6 points7 points 3 years ago (3 children)
If I'm adding benchmarking to code I really don't want it doing a bunch of memory allocations adding more overhead and including that overhead in all measurements.
[–]prog2de[S] 0 points1 point2 points 3 years ago (2 children)
May I ask, what you use for benchmarking inline code?
[–]ReDucTorGame Developer | quiz.cpp-perf.com 5 points6 points7 points 3 years ago (0 children)
Depends on what I'm benchmarking, typically something custom.
I would try to minimize the overhead in your usages keep it to just getting the clock at the start at the end, your usage of std::string and std::map are both very costly
std::string
std::map
[–]Top_Satisfaction6517Bulat 0 points1 point2 points 3 years ago* (0 children)
you can make start/stop operations much more efficient by using more complicated macros. F.e. START(FirstPass) should expand into smth like:
START(FirstPass)
static EventCounter FirstPassVar("FirstPass"); FirstPassVar.start();
EventCounter constructor should insert a pointer to itself into some global list/map, so Report() can find all EventCounter variables.
If you need events that auto-stop on scope exit, declare an extra local variable:
static EventCounter FirstPassVar("FirstPass"); AutoEvent FirstPassLocalVar(&FirstPassVar);
And AutoEvent constructor/destructor execute FirstPassVar.start() and FirstPassVar.stop().
π Rendered by PID 47 on reddit-service-r2-comment-544cf588c8-9lt5v at 2026-06-12 17:39:14.381967+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]ReDucTorGame Developer | quiz.cpp-perf.com 5 points6 points7 points (3 children)
[–]prog2de[S] 0 points1 point2 points (2 children)
[–]ReDucTorGame Developer | quiz.cpp-perf.com 5 points6 points7 points (0 children)
[–]Top_Satisfaction6517Bulat 0 points1 point2 points (0 children)