I am writing my own FIX engine and I am in the process of running some benchmarks. I am not sure whether my results are good or bad. Can someone with experience in the area provide me with some benchmark throughput numbers? How many FIX messages should my client be able to process per second?
We believe that the FIX parser (encoder/decoder) is the easiest part of a FIX engine to optimize. The bottleneck is usually the network I/O because you can't do any encoding/decoding before you receive/send the bytes from/to the network.
Below are the CoralFIX numbers we measured using an Intel Xeon 2.0GHz machine:
In terms of encoding (from
ByteBuffer), we can encode 5 million messages without producing any garbage in 1.408 micros on average per message.
In terms of decoding (from
FixMessage), we can decode 5 million messages without producing any garbage in 1.997 micros on average per message.
Now the same numbers using an Intel i7 3.5GHz machine overclocked to 4.5GHz:
ByteBuffer - 794 nanoseconds on average per message.
FixMessage - 1.1 micros on average per message.
If you want a rough estimate for throughput you can do the math:
Throughput = 1 second in nanos / (time above in nanos) = 1,000,000,000 / (time above in nanos)
But that will give you unrealistic numbers (> 1 million mps) because it is assuming that your network I/O time is zero. It does not help to save nanoseconds for parsing when you will be spending microseconds with network I/O.
Therefore we like to measure the combined time of reading the bytes from the network plus parsing the bytes into a
FixMessage. We have done this benchmark here, and the number was 250k fix messages per second read from the network and parsed.
Disclaimer: I am one of the developers of CoralFIX.
Fix8 has some benchmark results on their website. They provide the code, so you can run your own benchmarks with your FIX engine against either Quickfix or Fix8.