Hello I am curenntly using three REAL Time Charts (FiFo) in my WPF application and I am running into performance issues, which result in UI stuttering. I tried to optimize my performance using your very informative article on performance (Rendering,Stroke,Buffer etc.), but it did not help much, so I wondered if you might be able to help me.
I currently use three graphs and each of them has two different sets of data applied. The size of my FiFo graphs is 100 samples, with a dt= 0.01 (100Hz). I assume the OnNewData event is triggered at that rate as well?
My current code looks like this:
private void OnNewData(object sender, EventArgs e)
{
if (TaskManager.tempObject. != null)
{
lock (TaskManager.tempObject)
{
y0 = Math.Abs(TaskManager.tempObject.LaserPosRel - TaskManager.tempObject.AxisPos);
y1 = TaskManager.tempObject.AxisPos;
y2 = TaskManager.tempObject.AxisSpeed;
y3 = TaskManager.tempObject.AxisAcc;
y4 = y1;
y5 = TaskManager.tempObject.LaserPosRel;
}
}
using (sciChartSurface1.SuspendUpdates())
{
_series0.Append(t, y0);
}
using (sciChartSurface2.SuspendUpdates())
{
_series1.Append(t, y1);
_series2.Append(t, y2);
_series3.Append(t, y3);
}
using (sciChartSurface3.SuspendUpdates())
{
_series4.Append(t, y4);
_series5.Append(t, y5);
}
// Increment current time
t += dt;
}
I wondered if you have any proposals how to enhance my code, regarding performance?
Would it make a difference if I would Append the series in a new thread? I was not sure of this, since it is stated
in the FAQ that SciChart already uses it’s own threads for rendering.
Any help is appreciated, thanks in advance!
best regards
nils
- nesphit asked 8 years ago
- last edited 8 years ago
- You must login to post comments
Hi Nils,
To avoid stuttering, can you check the following?
- Ensure SciChartSurface.MaxFrameRate is set to NULL (or unset)
- Ensure SciChartSurface.RenderPriority is set to Normal (or unset)
- Ensure any DispatcherTimers in your application have DispatcherPriority.Render
Most importantly, check your Power Management settings in Control Panel. Are they set to High Performance? Balanced or power saver modes have CPU throttling which can make SciChart graphs appear to stutter.
In our Examples App we have a widget to change the power-management options. Check out the difference in performance between high and low power modes!!
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
- last edited 8 years ago
- You must login to post comments
Please login first to submit.