1 \addtogroup benchmarking-results
3 \brief Latest achievements in market data processing performance.
5 \section benchmarking-preface Preface
7 Benchmarking was performed using CME MDP emulator which
8 transmits data previously recorded on channels 360 and
9 384 of real CME production environment.
11 Simulated environment makes pauses (_Sending Delay_) between
12 two packets sent to determine the influence of network activity
13 onto market data processing performance.
15 Benchmarking measures _Market Data Processing Latency_ - the
16 time used by C++ CME Market Data Handler to process market data
17 starting with the moment when the Handler receives a packet from the
18 network till the moment when the Handler passes the results of a
19 packet processing to the users through correspondent callbacks.
21 Benchmarking results were obtained by the _Benchmark_ sample supplied
22 in a distribution package, and include latency for **Messaging events**,
23 **Direct Book Updates** and **MBO Book Updates**.
25 Benchmarking was done on a machine with Intel
26 Core i7-7700K CPU running Ubuntu 17.04 Linux.
28 \section benchmarking-market-data Market Data Traits
30 At the moment of benchmarking, 99% of messages, sent by MDP, contained
31 a single atomic operation over the book for a particular instrument.
33 The following table summarizes characteristics of market data on the channels:
38 ------------------------------------------------------|---------:|---------:
39 Instruments on the channel | 4069 | 1905
40 Average packet size in bytes | 429 | 178
41 Average/maximal number of bids/offers in direct book | 10/10 | 7/10
42 Average/maximal number of bids/offers in MBO book | 794/1569 | 270/690
46 \section benchmarking-messaging Messaging Latency
48 The given major release introduced a redesigned messaging subsystem.
49 Messaging the latency defines time since the moment of data reception
50 till the moment when received data is validated by a processing session
51 and passed to the users through the new OnixS::CME::MDH::MarketDataListener
57 <th rowspan=3>Sending<br>Delay<br> (ms)</th>
58 <th colspan=12>Latency (μs)</th>
61 <th colspan=6>360</th>
62 <th colspan=6>384</th>
79 <td align=right>0</td>
80 <td align=right>0.047</td>
81 <td align=right>0.049</td>
82 <td align=right>0.052</td>
83 <td align=right>0.066</td>
84 <td align=right>0.099</td>
85 <td align=right>0.378</td>
86 <td align=right>0.047</td>
87 <td align=right>0.048</td>
88 <td align=right>0.051</td>
89 <td align=right>0.060</td>
90 <td align=right>0.081</td>
91 <td align=right>0.435</td>
94 <td align=right>10</td>
95 <td align=right>0.079</td>
96 <td align=right>0.095</td>
97 <td align=right>0.096</td>
98 <td align=right>0.117</td>
99 <td align=right>0.135</td>
100 <td align=right>0.386</td>
101 <td align=right>0.047</td>
102 <td align=right>0.097</td>
103 <td align=right>0.087</td>
104 <td align=right>0.120</td>
105 <td align=right>0.153</td>
106 <td align=right>0.975</td>
109 <td align=right>50</td>
110 <td align=right>0.047</td>
111 <td align=right>0.071</td>
112 <td align=right>0.075</td>
113 <td align=right>0.110</td>
114 <td align=right>0.129</td>
115 <td align=right>0.592</td>
116 <td align=right>0.052</td>
117 <td align=right>0.082</td>
118 <td align=right>0.084</td>
119 <td align=right>0.120</td>
120 <td align=right>0.187</td>
121 <td align=right>0.571</td>
126 The visual presentation of latency depending on the interval
127 between two transmitted packets depicted on the following chart:
129 
131 \section benchmarking-book Book Maintenance Latency
133 Book maintenance latency represents the time spent by the Handler
134 starting from the moment data is received till the moment when
135 an updated order book is supplied through a correspondent callback.
136 Depending on the type of book, different callbacks are invoked by the
139 \warning The Handler publishes book updates at the end
140 of a certain market event like the _end of real quotes_
141 (atomic updates into direct and MBO books) or the _end of
142 implied quotes_ (atomic updates into implied books). Also,
143 in general, an event may consist of multiple messages
144 distributed across multiple packets. Therefore, the latency
145 for different types of books may differ significantly.
147 \subsection benchmarking-direct-book Market By Price, Direct Book
149 Measurements for direct book updates are gathered into the following table:
154 <th rowspan=3>Sending<br>Delay<br> (ms)</th>
155 <th colspan=12>Latency (μs)</th>
158 <th colspan=6>360</th>
159 <th colspan=6>384</th>
176 <td align=right>0</td>
177 <td align=right>0.104</td>
178 <td align=right>0.169</td>
179 <td align=right>0.183</td>
180 <td align=right>0.289</td>
181 <td align=right>0.379</td>
182 <td align=right>0.780</td>
183 <td align=right>0.107</td>
184 <td align=right>0.202</td>
185 <td align=right>0.214</td>
186 <td align=right>0.307</td>
187 <td align=right>0.378</td>
188 <td align=right>0.855</td>
191 <td align=right>10</td>
192 <td align=right>0.115</td>
193 <td align=right>0.217</td>
194 <td align=right>0.239</td>
195 <td align=right>0.390</td>
196 <td align=right>0.512</td>
197 <td align=right>1.420</td>
198 <td align=right>0.109</td>
199 <td align=right>0.225</td>
200 <td align=right>0.236</td>
201 <td align=right>0.344</td>
202 <td align=right>0.450</td>
203 <td align=right>1.678</td>
206 <td align=right>50</td>
207 <td align=right>0.126</td>
208 <td align=right>0.233</td>
209 <td align=right>0.250</td>
210 <td align=right>0.386</td>
211 <td align=right>0.469</td>
212 <td align=right>1.102</td>
213 <td align=right>0.128</td>
214 <td align=right>0.284</td>
215 <td align=right>0.301</td>
216 <td align=right>0.480</td>
217 <td align=right>0.700</td>
218 <td align=right>1.706</td>
223 Following diagram depicts table values visually:
225 
227 \subsection benchmarking-mbo-book Market By Order
229 The following table presents benchmarking results for MBO book updates:
234 <th rowspan=3>Sending<br>Delay<br> (ms)</th>
235 <th colspan=12>Latency (μs)</th>
238 <th colspan=6>360</th>
239 <th colspan=6>384</th>
256 <td align=right>0</td>
257 <td align=right>0.108</td>
258 <td align=right>0.252</td>
259 <td align=right>0.462</td>
260 <td align=right>1.591</td>
261 <td align=right>3.372</td>
262 <td align=right>8.223</td>
263 <td align=right>0.151</td>
264 <td align=right>0.300</td>
265 <td align=right>0.362</td>
266 <td align=right>0.704</td>
267 <td align=right>0.905</td>
268 <td align=right>3.158</td>
271 <td align=right>10</td>
272 <td align=right>0.181</td>
273 <td align=right>0.391</td>
274 <td align=right>0.653</td>
275 <td align=right>1.960</td>
276 <td align=right>4.022</td>
277 <td align=right>12.457</td>
278 <td align=right>0.125</td>
279 <td align=right>0.312</td>
280 <td align=right>0.394</td>
281 <td align=right>0.848</td>
282 <td align=right>1.056</td>
283 <td align=right>3.776</td>
286 <td align=right>50</td>
287 <td align=right>0.154</td>
288 <td align=right>0.395</td>
289 <td align=right>0.642</td>
290 <td align=right>1.933</td>
291 <td align=right>3.866</td>
292 <td align=right>14.535</td>
293 <td align=right>0.145</td>
294 <td align=right>0.370</td>
295 <td align=right>0.478</td>
296 <td align=right>1.015</td>
297 <td align=right>1.267</td>
298 <td align=right>4.188</td>
303 The diagram below displays the results visually:
305 
307 \subsection benchmarking-book-conclusions Conclusions and Important Notes
309 **Minimal latency of a book maintenance machinery is almost 10
310 times less in comparison to the book maintenance latency measured
311 for previous major release**. Such performance boost is achieved
312 by reducing processing time at session (messaging) level.
314 Also, in spite of both previous and latest major releases use
315 almost the same book maintenance machinery, **improvements implemented
316 in latest release provide significant (up to 25 times) reduction of
317 median latency compare to previous major releases** due to switching
318 using new memory management strategies and more effective data structures.
320 \note An important aspect of measuring an order book maintenance
321 latency is that order books are passed to the user at the end of
322 market event which in general may consist of multiple packets and
323 messages. Therefore, amount of data proportionally increases the
324 latency. One of the possible ways to have better latency is to use
325 a per-security book update notification strategy which instructs
326 the Handler to expose book as soon as a chain of atomic updates
327 is ended for a particular security without waiting for the end
328 of the entire event. This feature is supported by the Handler,
329 but it's not officially approved by CME. Therefore, using noted
330 book update notification strategy is on customer's risk.