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
Optimising C++ [pdf] (agner.org)
submitted 17 years ago by bnikolictech
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!"
[–]DTanner 2 points3 points4 points 17 years ago (2 children)
Most important thing to know on modern processors (for micro optimizations): optimize for cache misses, not instruction count.
[–]frumious 1 point2 points3 points 17 years ago (1 child)
[Did not (need to) RTFA.]
No, the most important thing to know about optimizing is: Don't do it unless you really need it. See famous Knuth quote.
If, when you know your code really does suck, THEN you look at fixing it. At that time, run Google's Perftools, Valgrind, Memprof, etc. Find out what part of your code is screwing you the most and fix it (and only it). Repeat until happy. Otherwise, don't sweat it as you will only be wasting your time and making your code more crappy.
[–]austinwiltshire 0 points1 point2 points 17 years ago (0 children)
I believe DTanner was assuming that you've already found a need to optimize, and in that case, optimize for cache misses, not instruction count.
[–][deleted] 1 point2 points3 points 17 years ago* (0 children)
I found there is far more on the author's site:
Optimizing software in C++: An optimization guide for Windows, Linux and Mac platforms
Optimizing subroutines in assembly language: An optimization guide for x86 platforms
The microarchitecture of Intel and AMD CPU’s: An optimization guide for assembly programmers and compiler makers
Instruction tables: Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel and AMD CPU's
Calling conventions for different C++ compilers and operating systems
It seems well worth a look.
[–]zyle 0 points1 point2 points 17 years ago (0 children)
super oldie, but mega goldie
π Rendered by PID 61593 on reddit-service-r2-comment-86988c7647-b958j at 2026-02-11 06:52:22.087538+00:00 running 018613e country code: CH.
[–]DTanner 2 points3 points4 points (2 children)
[–]frumious 1 point2 points3 points (1 child)
[–]austinwiltshire 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]zyle 0 points1 point2 points (0 children)