CPU usage
Hi,
I'm profiling my application to find areas of high cpu usage. I noticed that at some random time intervals, cpu usage goes to a 100. On looking at the analysis, I found that some property notified events take longer than usual. I have attached a screenshot here. Can you provide an insight into why this might be happening.
This is the code for one of the properties being called and the property changed event handler
protected int _Volume;
public int Volume
{
get { return _Volume; }
set
{
if (_Volume == value)
return;
_Volume = value;
//OnPropertyChanged(MarketDisplayModelProperty.Volume);
this.FireEvent("Volume");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void FireEvent(string eventPropertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(eventPropertyName));
}
}
Thanks,
Deepak
oro_profiler.png
-
Hi,
There are many reasons for it:
- Excessive synchronization with the GUI thread (one of main reasons). Max synchronization frequency is about 20 000 invokes/sec per application.
- Big number of controls and opened handles.
- Garbage collection (all threads in the application are suspended while this period).
- Which version of the grid do you use? In old versions, the grid could repaint big surfaces even a single field was updated.
Best regards,
Dapfor
0 -
I am using version 2.9.4. I did notice during my profiling that both times that this happened it was the same field(s) that were getting updated. I have 10-15 other fields on my grid that get updated frequently but only these two seem to have a problem. Both of them take in integer values( Volume and AskQty) . I don't think it can be a coincidence that it was the same two columns which were the problem. Keep in mind though that this doesn't happen all the time, it seems to be pretty random. Is there something with how these columns are bound /updated that could cause this problem ?
0
Please sign in to leave a comment.
Comments
2 comments