HFT in C++ -- Carl Cook, Optiver, "When a Microsecond is an eternity: High Performance Trading Systems in C++"

Video: https://www.youtube.com/watch?v=NH1Tta7purM

Speaker: Carl Cook, Ph.D. -- carl.cook @ google's email

Company: Optiver

Carl explains very nicely what are HFTs (from a developers point of view) and also gives hints on some strategies, like Market Making.

He is a developer for trading/finance companies and is a member of ISO SG14, which he said has to do with trading, but I only found references for low latency game development -- it appears to be a library worth measuring. Yes it is: github /WG21-SG14/SG14

Although he declared himself not a C++ expert, he stood foot this is the language of choice for the task. Apart from some odd statements like "my application does not use threads", "single core application has lower latency than multi core ones" and used float all over instead of int, he showed a very competent setup on measuring times on a simulated environment -- some might argue that it wasn't needed at all and that his implementation of the simulated exchange could be the greater influencing factor, but lets give him credit for having tested that.

Although I think I heard he mentioning EASTL, he emphasized that he uses google's dense_hash_map for performance improvements over std::unordered_map -- according to my measurements, dense_hash_map uses more RAM and CPU cycles than many other solutions. He mentioned all over his talk using std:: containers and other slow std:: facilities, like std::function and seemed to not know what Perfect Hash is, for he couldn't answer to a question in this direction.

He didn't mention logging on the talk, but on the comments -- which "he does in another thread". He has a talk on that in https://youtu.be/ulOLGX3HNCI?t=28m14s.


Notes on his second video:

  • Logging (with varidic tempates, constexpr and macros -- just with mov instructions): github maciekgajewski/Fast-Log and github carlcook/varidicLogging
  • Hash tables implementations to add to my HashTableSpikes: http://www.reedbeta.com/blog/data-oriented-hash-table/
  • There is this interesting Include OS -- https://www.includeos.org. It seems to be an OS designed to be a bare metal: you ship your executable + the pieces of the linux kernel you need/want and it is able to boot from that. It makes it fast and secure. Lets try...