Major preformance improvement in core networking
I recently made some changes to the RunUO core with some of the newest .Net socket patterns and tested under load I see a very significant performance increase, hence the reason I am posting.
Currently the RunUO core uses the .Net asynchronous networking that has always been present since .Net 1.1, which has always been great but with one major drawback, being that AsyncEvents and buffers are recreated fragmenting the heap, causing garbage collection, etc. The heap actually gets very fragmented eventually due to the fact during network operations the memory is pinned for sending/receiving.
Microsoft remedied this problem in .Net 3.0 by including the SocketAsyncEventArgs interface which lets you create a set amount of EventArgs for concurrent processing and reuse them in a pool. This was included strictly for high performance and high volume servers. The performance improvement are quite amazing, as I tested with my robot client and hammered the server and saw a nearly 50% performance increase and I think I could get more out of it with a few smaller optimizations.
The main Microsoft article can be found here: SocketAsyncEventArgs Class (System.Net.Sockets) and if anyone is interested or has any questions feel free to ask.
Sorry if this is the wrong forum, I'm more of an occasional lurker
I recently made some changes to the RunUO core with some of the newest .Net socket patterns and tested under load I see a very significant performance increase, hence the reason I am posting.
Currently the RunUO core uses the .Net asynchronous networking that has always been present since .Net 1.1, which has always been great but with one major drawback, being that AsyncEvents and buffers are recreated fragmenting the heap, causing garbage collection, etc. The heap actually gets very fragmented eventually due to the fact during network operations the memory is pinned for sending/receiving.
Microsoft remedied this problem in .Net 3.0 by including the SocketAsyncEventArgs interface which lets you create a set amount of EventArgs for concurrent processing and reuse them in a pool. This was included strictly for high performance and high volume servers. The performance improvement are quite amazing, as I tested with my robot client and hammered the server and saw a nearly 50% performance increase and I think I could get more out of it with a few smaller optimizations.
The main Microsoft article can be found here: SocketAsyncEventArgs Class (System.Net.Sockets) and if anyone is interested or has any questions feel free to ask.
Sorry if this is the wrong forum, I'm more of an occasional lurker