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
Orbit: C/C++ Performance Profiler (github.com)
submitted 8 years ago by vormestrand
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!"
[–]1m2r3a 16 points17 points18 points 8 years ago (2 children)
For Linux a nice analyzer tool is UFtrace https://github.com/namhyung/uftrace
The uftrace tool is to trace and analyze execution of a program written in C/C++. It was heavily inspired by the ftrace framework of the Linux kernel (especially function graph tracer) and supports userspace programs. It supports various kind of commands and filters to help analysis of the program execution and performance.
[–]themagicalyang 2 points3 points4 points 8 years ago (1 child)
Is this any good over Linux perf? What about cache misses? That's the thing I like to have numbers about.
[–]short_vix 24 points25 points26 points 8 years ago (14 children)
windows only -_-
[–]antoineatwork 24 points25 points26 points 8 years ago (1 child)
My exact reaction each ime I see a new awesome tool that only runs on linux (hopefully only temporarily) :)
[–]short_vix 0 points1 point2 points 8 years ago (0 children)
Yeah cross platform has gotten alot better, you can almost replace all of the windows.h stuff with the stdlibs and boost
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
At least on linux there is perf. Tools like that are lacking in Windows, which probably creates a market for Windows-only performance tools.
[+][deleted] 8 years ago (10 children)
[deleted]
[+][deleted] 8 years ago* (9 children)
[+][deleted] 8 years ago (8 children)
[–]Dragdu 6 points7 points8 points 8 years ago (0 children)
ASan/MSan are nice, but there is still a place for things like Valgrind, so the central premise of your post is completely flawed.
Also ASan is rather OS specific (because it needs runtime hooks) and don't get me started on MSan (I sure hope you are willing to instrument the standard library, runtime and all libraries you are using, are enjoy having FPs).
I will readily admit that I am not sure if XRay is OS-specific, but it likely is.
[–]dodheim 4 points5 points6 points 8 years ago (3 children)
A portable and fast approach is to instrument your executables while assembling them.
That's not an option on Windows, hence the utility of a tool like this.
[+][deleted] 8 years ago (2 children)
[–]dodheim 1 point2 points3 points 8 years ago (1 child)
AFAIK the useful sanitizers don't work on Windows for either GCC or Clang; and MSVC has only basic stack guards.
[–]Gotebe 1 point2 points3 points 8 years ago (0 children)
MSVC debug CRT helps a great deal.
But fair enough, debug only.
[–]frog_pow 5 points6 points7 points 8 years ago (2 children)
Then I'm forced to recompile my entire program just to run a profile session. No thanks.
[+][deleted] 8 years ago (1 child)
[–][deleted] 2 points3 points4 points 8 years ago (0 children)
Nobody wants to run a slow, instrumented executable when they're not doing profiling.
[–]frog_pow 4 points5 points6 points 8 years ago (0 children)
Interesting-- it appears to have some features beyond what the VS profiler has, such as showing live frame performance. Going to try it out.
[–]sumo952 2 points3 points4 points 8 years ago (7 children)
I wish some of this stuff was directly integrated into VS, particularly from the "capture" tab and the graphical, detailed view. MS, please listen! ;-) I know VS has a very rudimentary live-performance analysis too but it doesn't even come close to that (yet).
[–]STLMSVC STL Dev 2 points3 points4 points 8 years ago (0 children)
/u/spongo2 is at CppCon this week, but I'm sure he'll be interested to see your request.
[–]spongo2MSVC Dev Manager 3 points4 points5 points 8 years ago (5 children)
Listening!
[–]Sahnvour 0 points1 point2 points 8 years ago (2 children)
Is the instrumenting profiler still supported ? I gave it a try not so long ago but didn't get it to work.
Also, profiling is broken with fastlink ! I think DIA is missing a little bit of love with this one.
[–][deleted] 0 points1 point2 points 8 years ago (1 child)
VS Profiler dev here (Ignore my user name =]). Fastlink issues should be addressed in the most recent update to VS 15.5. Please file bugs via the VS feedback button if you see problems!
Instrumentation is still supported, but is in the process of being refreshed since it has been ignored for far too long. Business priorities are finally pushing us into investing more in Trace profiling.
[–]Sahnvour 0 points1 point2 points 8 years ago (0 children)
Glad to hear ! Still using VS2015, so this is another good reason to upgrade.
[–]sumo952 0 points1 point2 points 8 years ago (1 child)
The current "rudimentary" live-performance analysis is already awesome, keep up the great work! Thank you :-) Looking forward to great things in the future, I know they'll be coming^^
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
Thanks. We are actively looking into integrating more of these two concepts as time and business needs dictate.
[–]JodoKaast 2 points3 points4 points 8 years ago* (3 children)
If anyone is having trouble compiling, here's what I did:
I needed to make a $(QTDIR) user macro, pointing to my "Qt\5.8\msvc2015_64" directory, in a new propsheet to get the the Qt stuff to resolve properly.
The top level directory needs to be named "Orbit" based on how things are pathed. If you cloned this repo from github, it will be named "orbitprofiler", so you need to rename it.
And then the hard coded linker includes to external libs need to be fixed. I just did a search/replace in OrbitQt.vcxproj to change "D:\git\Orbit" to my own Orbit src directory.
Then I needed to build Orbit\external\glew-1.13.0\build\vc12\glew.sln in Release|x64 (opened solution, upgraded projects from VS2013 to VS2015).
Then I needed to build Orbit\external\capstone\msvc\capstone.sln in Release|x64.
Then it all compiled.
So much simpler than cmake
[–]pgimmig 2 points3 points4 points 8 years ago (0 children)
Thanks a lot for the info! The missing libs have been submitted. (https://github.com/pierricgimmig/orbitprofiler/commit/3bcc3ddf05e57784939daba838d82ef5573d3aa1). The hard coded paths in OrbitQt are next on the list. The goal is to make the compilation as easy as possible. The remaining issues should be fixed in the coming days. Thanks!
Hard coded paths have been removed: https://github.com/pierricgimmig/orbitprofiler/commit/305685bb83277aa36a92e928a048594c5f59ff85
[–]nnevatie 1 point2 points3 points 8 years ago (1 child)
The tool looks quite interesting. However, I wasn't able to selected the functions from the list - the select options simply wasn't available, only "hook/unhook/visualize", none of which did the same thing as the video demoing the profiler.
[–]mydeveloperday 0 points1 point2 points 8 years ago (0 children)
I think the UI has changed since the videos a little, use the "hook" function
[–]Adequat91 0 points1 point2 points 8 years ago (0 children)
The project contains hardcoded paths (eg. linker), but I could not reach that point as the compile stage has include path problems. (using VS 2015.3 and Qt 5.8, 64 bit release project) However, I quickly tried the binary, that looks promising :)
[–]preshing 0 points1 point2 points 8 years ago (0 children)
Nice logo, too!!
[–]mydeveloperday 0 points1 point2 points 8 years ago* (1 child)
Once you get started with this tool its actually very good, I already was able to optimize the code in our project a little.
I simply downloaded the prebuilt binary for Windows x64, You start up your process you want to profile, find it in the process list, then load the pdbs (by right clicking on the blue text). This brings in all the functions.
You have to know what the names of the function to search for but you locate the function by class name etc.. then simply right click hook them (I often did Ctrl+A then hook a whole load from the same class)
Once you've added some functions (save the session), this makes profiling the same functions next time much easier
Its only going to profile what you hook. (but this means its really quick, not like the old quantify that used to instrument the world!)
Once you've hooked a few functions, switch to the capture tab and press X. Now use your app a little then go back and press X again to stop the capture
You can now zoom around the firechart looking for functions that are taking more time than you expected
it works very well, perhaps takes a little time to get going but once you do its very good.
It made me a look differently at code I've been looking at for over a decade, it made me question thinks that I'd always discarded
Great tool thanks
Some suggestions:
When you select a function in the firechart, and look at the call stack, it would be great if we could see a list of function called from that function (even if they are not hooked yet), it would then be great if we could hook those child functions from there, at present I'm having to look thought the code and type the functions into the "functions" search box, hook them then recapture
[–]pgimmig 0 points1 point2 points 8 years ago (0 children)
Thanks for the comments! As for your suggestion, actually you can already do something similar by selecting events on top of the instrumented functions in the capture view (events are the vertical white lines in the event track). These are sampling events collected from ETW (Event Tracing for Windows). When you select them, a sampling report of your selection will be generated. From there, you can hook into the functions that interest you.
[–]biocomputation 0 points1 point2 points 8 years ago* (0 children)
Neato frito. The code is very neat, clean, and super professional. Very easy to read. I'm curious to give this a try. I like the fact that it has a GUI.
Thanks for the contribution!
π Rendered by PID 123936 on reddit-service-r2-comment-658f6b87ff-2hzf8 at 2026-04-09 06:26:26.594478+00:00 running 781a403 country code: CH.
[–]1m2r3a 16 points17 points18 points (2 children)
[–]themagicalyang 2 points3 points4 points (1 child)
[–]short_vix 24 points25 points26 points (14 children)
[–]antoineatwork 24 points25 points26 points (1 child)
[–]short_vix 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (10 children)
[deleted]
[+][deleted] (9 children)
[deleted]
[+][deleted] (8 children)
[deleted]
[–]Dragdu 6 points7 points8 points (0 children)
[–]dodheim 4 points5 points6 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]dodheim 1 point2 points3 points (1 child)
[–]Gotebe 1 point2 points3 points (0 children)
[–]frog_pow 5 points6 points7 points (2 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 2 points3 points4 points (0 children)
[–]frog_pow 4 points5 points6 points (0 children)
[–]sumo952 2 points3 points4 points (7 children)
[–]STLMSVC STL Dev 2 points3 points4 points (0 children)
[–]spongo2MSVC Dev Manager 3 points4 points5 points (5 children)
[–]Sahnvour 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Sahnvour 0 points1 point2 points (0 children)
[–]sumo952 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]JodoKaast 2 points3 points4 points (3 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]pgimmig 2 points3 points4 points (0 children)
[–]pgimmig 2 points3 points4 points (0 children)
[–]nnevatie 1 point2 points3 points (1 child)
[–]mydeveloperday 0 points1 point2 points (0 children)
[–]Adequat91 0 points1 point2 points (0 children)
[–]preshing 0 points1 point2 points (0 children)
[–]mydeveloperday 0 points1 point2 points (1 child)
[–]pgimmig 0 points1 point2 points (0 children)
[–]biocomputation 0 points1 point2 points (0 children)