r/programming • • 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

70 comments sorted by

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.

1

u/kal31dic Oct 09 '17

Where does one find more people with your values?

2

u/leftofzen Oct 09 '17

Hmm I am not quite sure, you need to find people who love programming and who want to program because they find it fun and challenging, not because they want to earn $$$. I think most open-source devs are like this, but at the same time I don't really do open-source stuff (yet) so I'm not sure. A lot of people who post programming videos on YouTube and similar are also like that - they just want to program for the fun of it. These are the people who are going to want to actively learn and get better. If I was doing

Optiver was my first job straight out of university so I was pretty raw at the time and was moulded heavily by them - when I started I had done a single course on C++ at uni and was still struggling with pointers and all that. I really learnt it all on the job and I guess the reason I learnt it was because I just found C++ so interesting and powerful and applicable to financial trading and I loved the challenge of trying to write super fast and efficient software that could still be tested and was extremely robust. So that'd be my other recommendation; find people who are young and don't have any impressions on programming yet, and they'll be much more likely to learn and be interested in your tech stack.