1. reduce the encode/decode latency
2. reduce message and field ctor./ dtor times
3. optimise internal message field lookups
I have also included a new test application designed to provide an example of high frequency use. The new application is called hftest and will be built by default. Its configuration and operation is similar to the other test client/server f8test.
You can preload (pre-construct and populate) a specified number of NewOrderSingle messages and then transmit them in one go. In the following example, we preload 200000 orders and send them. The server then responds with ExecutionReports (acks and fills).
The following is an example run:
% ./hftest -r -l client
0000001 A 2012-05-21 09:18:43.632024292 Starting session
0000002 A 2012-05-21 09:18:43.632259581 Trying to connect to: 127.0.0.1:11002 (1)
0000003 A 2012-05-21 09:18:43.632577430 Connection successful
0000004 A 2012-05-21 09:18:43.632741462 Session connected
0000005 B 2012-05-21 09:18:43.637290025 Heartbeat interval is 5
a Send all Preloaded NewOrderSingle msgs
n Send a NewOrderSingle msg
p Preload n NewOrderSingle msgs
0 NewOrderSingle msgs currently preloaded.
Enter number of NewOrderSingle msgs to preload:200000
200000 NewOrderSingle msgs preloaded.
200000 NewOrderSingle msgs sent
0 NewOrderSingle msgs remaining.
787000 ExecutionReport msgs received
0000006 C 2012-05-21 09:25:31.043745212 Session terminating
On my test machine which is a
mac mini (Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz)
running Ubuntu 12.04 64 bit
encode 20us, decode 72us, ctor 8us, dtor 3.4us
encode 17us, decode 70us, ctor 7us, dtor 2.6us