There are several tips to achieve minimum latency.
- Configure process priority and affinity.
- Turn off logging.
- Using Native Image Generator.
Configure process priority and affinity.
To achieve minimum latency process priority of application that uses handler should be set to High or even Realtime.
Because handler uses several threads, application should not be limited to one processor core.

Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime; //Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(2); // If this line // will be uncommented, apllication will be limited to second processor core only.
Turn off logging.
TraceSwitch based logging is used. All trace switches should turned off via App.config file or static properties of the Handler class.
For example:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <switches> <!-- This switch controls general messages. In order to receive general trace messages change the value to the appropriate level. "0" gives nothing "1" gives error messages, "2" gives error and warning messages, "3" gives error, warning and info messages, "4" gives error, warning, info and verbose messages. --> <add name="Onixs.CmeFastHandler" value="0"/> <add name="Onixs.CmeFastHandler.Receivers" value="0"/> <add name="Onixs.CmeFastHandler.FixMessages" value="0"/> <add name="Onixs.CmeFastHandler.OrderBook" value="0"/> </switches> </system.diagnostics> </configuration>
or:

Handler.TraceSwitch.Level = TraceLevel.Off; Handler.ReceiversTraceSwitch = TraceLevel.Off; Handler.FixMessagesTraceSwitch = TraceLevel.Off; Handler.OrderBookTraceSwitch.Level = TraceLevel.Off;
Using Native Image Generator.
The Native Image Generator, or simply NGEN is the Ahead-of-time compilation service of the .NET Framework. It allows a .NET assembly to be pre-compiled instead of letting the Common Language Runtime do a Just-in-time compilation at runtime. In some cases the execution will be significantly faster with AOT than with JIT.
To install handler assembly to Native Image Cache Visual Studio Command Prompt should be started and next command should be executed:
ngen install <handler assembly name>
To remove handler assembly from Native Image Cache Visual Studio Command Prompt should be started and next command should be executed:
ngen uninstall <handler assembly name>