How to measure the response time of operations against GridView

1 posts, 0 answers
  1. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 21 Aug 2015 Link to this post

    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

Back to Top