Performance improvements in the Socket Server Framework

I’m just finishing a batch of work that will be included in the 6.2 release of my IOCP based, high performance windows client and server framework and which improves the performance of the framework. There are two main improvements; the first is that the filtering API is now completely optional. There are now filtering and non-filtering base classes so that you only need to include filtering support if you need it. This removes a considerable amount of code that was not required for the non-filtering servers and improves performance by a small amount. The framework base classes are now templatised so that filtering is included only if you want it. There are no changes to user code unless you are actually using filtering in which case you need to switch you base classes to the new filtering ones.

Whilst making these filtering changes the filtering API has been brought to the datagram side of the framework and I’m currently working on various filters and examples of their use; as with the stream socket filtering API you need to select the correct base class to include the functionality.

The second performance improvement is only available for code running on Vista/Server 2003 and later operating systems and involves incorporating the changes that I spoke of here and here to enable FILE_SKIP_COMPLETION_PORT_ON_SUCCESS and FILE_SKIP_SET_EVENT_ON_HANDLE. This is a configurable option that can be set in Config.h and which can be set differently for stream and datagram sockets (mainly due to the fact that there appear to be some issues with setting these options on datagram sockets (see here and here)). In testing these options make quite a considerable difference to performance and I expect that they’ll be even more effective on heavily loaded servers as they reduce the amount of thread context switching as many I/O completions can be handled on the thread that issued the I/O request rather than by pushing the completion through the I/O completion port.

These changes will be available in release 6.2 which currently doesn’t have a release date but which should be available in the first quarter of 2010.