OnixS ICE iMpact Multicast Price Feed Handler C++ library 8.18.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Low Latency Best Practices

The given topic explains how to configure the Handler to achieve optimal performance and lowest possible processing latency.

Configuring Logging Subsystem

Under normal conditions, the Handler logs important events and market data from the iMpact Multicast Price Feed to a log file. Since the log file uses a text-based format, binary data such as incoming market data is base64-encoded before being stored in the log. That adds extra time to the processing cycle. Finally, logging is file-based and thus is relatively slow.

To eliminate slowdowns caused by flushing data to the filesystem and/or extra encoding operations, the logging subsystem should be disabled by setting HandlerSettings::logLevel parameter to LogLevels::Fatal value and HandlerSettings::advancedLogOptions parameter to AdvancedLogOptions::LogNothing.

Turning Up Working Threads

Market data processing is performed asynchronously using worker threads. Under normal conditions, threads may be executed on any processor available in the system. That may negatively affect overall performance due to unnecessary thread context switching.

To avoid switching threads between processors, Handler allows establishing processor affinity for each working thread:

FeedEngineSettings feedEngineSettings;
feedEngineSettings.threadAffinity.insert(1);

Suppressing Market Data Copying

Under normal conditions, Handler effectively utilizes internal structures used to keep incoming market data. Packets and ICE iMpact messages are reused once the contained data is processed by the Handler. Therefore, no data is allocated during real-time market data processing.

However, data may be copied within the callbacks that the Handler invokes as a listener for various market data events. Thus, when a book is copied, it triggers memory allocation, which negatively affects performance and latency. To improve results, copying should be minimized, or preallocation strategies should be used.