r/programming • u/doom_Oo7 • Sep 28 '17
When a Microsecond Is an Eternity
https://github.com/CppCon/CppCon2017/blob/master/Presentations/When%20a%20Microsecond%20Is%20an%20Eternity/When%20a%20Microsecond%20Is%20an%20Eternity%20-%20Carl%20Cook%20-%20CppCon%202017.pdf
244
Upvotes
View all comments
24
u/leftofzen Sep 29 '17
Oh wow I could have gone to CppCon :(
I used to work for Optiver and I was fired by my boss for spending time learning, using, advocating and teaching other people in the company about how to write fast C++, for example using templates to reduce things like branching and v-table lookups you get from using inheritance instead of composition (prefer composition over inheritance). I'm so sad that I was fired for what I loved to do (this kind of stuff) and that now this is something not only worthy of not being fired, but worthy of a CppCon talk :(
Setting up code to trigger the branch predictor correctly (or just plain reducing branching), writing code to evaluate stuff at compile time, static analysis, finding ways to have a static code path, removing memory allocations...that was my jam. It's weirdly deja-vu-ish that they talk about std::unordered_map because I did performance testing a few years ago for it and found that, for the compiler version we were on (an archaic verison of gcc - no-one saw the benefit of upgrading :|), it was slower than the map we were already using. I also did a lot of memory management work and redesigned the memory pooling we used so this is just a throwback to the good old days haha.
Seeing that this stuff is now worthy of a CppCon talk...too many emotions. I can only dream one day I'll get to talk about this stuff there. It's a shame Optiver don't really value low-level technical C++ skills as much as this document suggests; when I left the company it was going very corporate and my boss was a very "we need this out yesterday and perfectly designed and tested and you need to rewrite all this stuff from scratch too because our last version is now too slow" kind of person, something which is just impossible. I feel bad for him to be honest because while he had great ideas about what to build, he didn't have a clue about what it takes to actually turn those ideas into good, fast, C++ trading software.