Windows: Investigate speed and CPU improvements with IO Completion Ports #1

Open
opened 2019-01-06 11:55:15 +01:00 by Xaymar · 5 comments
Xaymar commented 2019-01-06 11:55:15 +01:00 (Migrated from github.com)

From gathered info, this might allow for even better parallelism on high-core count CPUs, removing the need to stall on read and accept.

Related Links:

From gathered info, this might allow for even better parallelism on high-core count CPUs, removing the need to stall on read and accept. Related Links: * https://docs.microsoft.com/de-de/windows/desktop/FileIO/i-o-completion-ports * https://docs.microsoft.com/de-de/windows/desktop/FileIO/createiocompletionport
Xaymar commented 2019-01-06 23:48:04 +01:00 (Migrated from github.com)

Accept benefits from this due to the ability to accept the next connection while the on_accept handler is being executed in an IO Completion Port thread. There is also no longer the limit of 64 concurrent connection checks.

Read and Write can benefit from this by being fully asynchronous. Read would no longer wait on the previous on_message to be completed and instead be able to immediately try and read the next header. Write would be even more asynchronous.

Definitely worth experimenting with.

Accept benefits from this due to the ability to accept the next connection while the on_accept handler is being executed in an IO Completion Port thread. There is also no longer the limit of 64 concurrent connection checks. Read and Write can benefit from this by being fully asynchronous. Read would no longer wait on the previous on_message to be completed and instead be able to immediately try and read the next header. Write would be even more asynchronous. Definitely worth experimenting with.
Xaymar commented 2020-02-02 22:01:21 +01:00 (Migrated from github.com)

Working on this now for another project. IOCP benefits are primarily having the OS do NUMA awareness for us, which drastically improves speed on platforms like ThreadRipper Zen/Zen+ and EPYC. Desktop CPUs will likely also see an increase as the OS will likely schedule things to run on the best core.

Working on this now for another project. IOCP benefits are primarily having the OS do NUMA awareness for us, which drastically improves speed on platforms like ThreadRipper Zen/Zen+ and EPYC. Desktop CPUs will likely also see an increase as the OS will likely schedule things to run on the best core.
Xaymar commented 2020-02-09 03:21:48 +01:00 (Migrated from github.com)

Completely redesigned Server/Socket model to be easier to use. It is now entirely callback based. The new design is also friendlier towards Linux and Android and allows full control over messaging.

Completely redesigned Server/Socket model to be easier to use. It is now entirely callback based. The new design is also friendlier towards Linux and Android and allows full control over messaging.
Xaymar commented 2020-03-05 13:07:11 +01:00 (Migrated from github.com)

Final problem encountered is an odd, unexplainable packet loss of around 3%. This sounds impossible as it should all be on the same machine, but it does happen somehow.

Final problem encountered is an odd, unexplainable packet loss of around 3%. This sounds impossible as it should all be on the same machine, but it does happen somehow.
Xaymar commented 2020-06-21 12:48:34 +02:00 (Migrated from github.com)

Packet/Data loss seems to be fixed by Win2004.

Packet/Data loss seems to be fixed by Win2004.
Sign in to join this conversation.