Rewrote the NBBO Engine – Better, Faster, More General (cont.)
Today I had to do a little hammering on my new NBBO engine because I found a few problems in what it was doing. I wasn't properly filtering out bad data from the NBBO calculation, and that needed to change. Plus, I wanted to add a simple method to force a recalc of the NBBO because I was seeing bad data get "stuck" in the engine, and wanted to have some way to clear it out. Finally, I introduced a bug in the forced recalc that I had to find - silly cut-n-paste bug, but easily found.
But the nice change I did was to realize that the exchange data for the instruments could skip having the security key - a textual representation of the security, and just use the security ID - a 128-bit number that was equivalent to the security key. The difference was that I could skip the conversion from the key to the ID, and that saved an amazing 33%. I was able to get my times down to about 22 μsec - just amazing.
Consequently, the engine takes 33% less CPU and that directly translates to more feeds on the box. That's always a good thing. Very nice fix/change.