Hi,
I have the following issue and am not sure what's the best way to tackle this:
The application I'm dealing with utilizes live financial market data for stocks, options, etc. So, there is one class that handles all the market data subscriptions and emits the quote as an event.
There are several controls which subscribe to this Quote event and process the data the event delivers.
The issue with this is that one control might subscribe to market data for MSFT and the other control might need data for IBM, however they are still subscribed to the same event and thus the control itself has to filter the incoming data from the event and determine if it needs to process it or not. Performance profiling showed me that this is pretty much a non issue and thus can't cause any performance spikes.
So, what I'm experiencing is that when I'm running only 1 of those controls, CPU usage is at 3% max. However, as soon as I open two of those controls, I suddenly see spikes up to 25%!
This is really giving me a headache because I can't see why this is happening.
One of my thoughts was that since there are several subscribers to this event, the CPU clocks are running high while one control processes data while the others have to wait to process it as they all process on the UI thread. If this is the case, what would be the best way to solve this
I hope someone is following my problem here and give me some advice.
Thanks,
Tom

Events & Delegates CPU spikes
tusAugusto
Matt Anderson
Tom,
What you could be seeing is the Garbage Collector running. Are you creating a lot of instances of any particular classes
Not sure what performance profiling you've done, but have you looked at memory profiling to see it this could be your issue
You can download the free .NET CLR Profiler which does this, from here:
http://www.microsoft.com/downloads/details.aspx familyid=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en
Leung
thanks for your reply. I'm using ANTS Profiler quite extensively for performance profiling, however its memory profiling doesn't show me Gen x collections. I tried the .NET CLR Profiler but my application crashes when I launch it with the profiler
Regards,
Tom
Chris Mann
JWeil
Hi Tom
You can use the performance counters to measure GC information (% time spent, generation collections, etc). Just launch perfmon.exe and register the .NET Memory counters you're interested in.
Hope that helps
-Chris