This is a migrated thread and some comments may be shown as answers.

How to measure the response time of operations against GridView

0 Answers 31 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jackey
Top achievements
Rank 1
Jackey asked on 21 Aug 2015, 02:04 PM

Hi team,

We know that we need to leverage the UI Virtualization of RadGridView to improve its performance. But sometimes I still suffer some big latency, so I would want to know which part of is to be blamed. One of ways i know is shown below.

private Stopwatch _watch;
private ILog _log;
 
public HistoryData()
{
    InitializeComponent();
 
    this._log = LogManager.GetLogger(typeof (App));
    _watch = Stopwatch.StartNew();
    this.HistoryDataGridView.Filtering += this.ResetTime;
 
    this.ResetTimeAndSubscribeToLayoutUpdated();
}
 
private void ResetTime(object sender, GridViewFilteringEventArgs e)
{
    ResetTimeAndSubscribeToLayoutUpdated();
}
 
private void ResetTimeAndSubscribeToLayoutUpdated()
{
    this.HistoryDataGridView.LayoutUpdated += this.HistoryDataGridView_LayoutUpdated;
 
    this._watch.Restart();
}
 
private void HistoryDataGridView_LayoutUpdated(object sender, EventArgs e)
{
    this.HistoryDataGridView.LayoutUpdated -= this.HistoryDataGridView_LayoutUpdated;
 
    _log.Info(string.Format("GridView operations take {0} ms", this._watch.ElapsedMilliseconds));
}

The elapsed milliseconds logged here is usually no more than 3000, but sometimes, I feel like it's taking 6~9 se​conds to ​display the final GridView. So i want to know deeper insights of where and when the GridView spend time on

 Thanks,

-J

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Jackey
Top achievements
Rank 1
Share this question
or