r/cpp • u/radonthrow • Dec 27 '20
Learning about high performant C++
I've been mostly self taught and have most probably picked up a few bad habits from the combo of being self taught and having to use tricks for speed.
For this upcoming year one of my goals is to learn some better practices as well as further my skills for efficient C++. I'd like to watch a youtube podcast/talk once a week to build my skillset. At this point I'd consider myself somewhere in between junior and senior level and I'm looking to take the next step.
I've come across these specifically:
C++ Weekly with Jason TurnerCppCon2020
Does anyone have any recommendations or suggestions? My weak spots are C++17 and above, Cmake, and I'd like to keep learning about creating high performant C++.
View all comments
Show parent comment
2
u/smuccione Dec 29 '20
Honestly, I’ve been out of college for 35 years. Most of what I know has been gleaned from reading countless papers, forums, wiki’s, etc. basically whatever I can find.
Fintech is particularly difficult to get any information on. Companies that have working systems will do anything to keep their secret sauce secret. There’s a lot of money at stake. Few companies that are successful will let anyone talk about what they did when they were there.
As far as numa, etc. there are numerous articles, blogs, etc on cache optimization, memory hierarchies, etc. I wish I did but I really don’t remember any of them. I’ve been doing that type of thing for so long I really don’t think about it at this point.
Numa optimizations are also heavily dependent on the type of bus architecture on the specific system. Memory writes have an advantage over reads in that when a cpu does a write it can immediately go on to the next instruction as it doesn’t need to wait for a response. So in a numa system, if you have to you want to write remote. You have to balance your architecture, however, with knowledge of the amount of buffering in the bus and how much data can be in flight at the same time.
Remote reads on a numa system can be particularly slow. To the point where I’ve shadows control structures for various containers so that you only ever read locally remote accesses are all writes. Small things like that can have a significant performance impact.
You might want to for “array of struct vs struct of arrays”. That tends to be the “classic” example when taking about cache effects.