Last post Jun 29, 2015 04:36 AM by gtscdsi
Jun 23, 2015 09:02 PM|Meadock|LINK
I'm in the middle of developing a realtime game application using SignalR. I've put in a lot of effort to make sure that my code does not generate any memory garbage that would cause periodic garbage collections. I'm able to verify this with unit tests
and perfmon / dotMemory. I started my application up in IE and ran these profilers against it. I found that that a lot of new objects are being created and causing garbage collections and in the process causing my game to lag every once in a while. dotMemory
showed me that the main culprit is Microsoft.AspNet.SignalR.Messaging.Message (System.Bytes). At first I thought I might have to worry about hub creation causing garbage creation, but it looks like it's the Message object. Is anyone else aware of this?
Are there any plans to find a solution for this so that SignalR will perform better with realtime game applications? Some suggestions for a possible solution for this would be to create a MessagePool or make Message a struct. But since I'm not familiar with
he inner workings of SignalR, I'm not sure how feasible these two solutions would be.
I've already read the SignalR performance article (http://www.asp.net/signalr/overview/performance/signalr-performance). I'm going to work on implementing some of the suggestions
I found there to try to mitigate the impact of garbage collections. I consider this a temporary workaround though. If need be, I might just decide to get my hands dirty and mess around with OWIN, but that seems like it might be a massive undertaking for
me. Any advice, thoughts, information would be greatly appreciated. Thanks in advance.
Jun 29, 2015 04:36 AM|gtscdsi|LINK
Thanks for your post. For SignalR performance issues, you may need to continue optimizing your application by referencing the SignalR performance article you already read. By the way, please keep using the latest version of SignalR.