Improve the performance for datagrid setups.

Review Request #7217 — Created April 16, 2015 and submitted

Information

Djblets
release-0.9.x
c3f0f96...

Reviewers

The datagrid needs to shuffle around some elements and their visibility
when setting up state. This was involving one more loop than needed
and some inefficient element lookups.

We now use children() where possible, instead of find(), to do the
lookups. Two for loops were also collapsed into one.

There were also some redundant lines of code that could be replaced with
pre-computed values.

Last, but not least, the new thead is hidden until we build it and are
ready to switch to it. This avoids some extra rendering.

Tested with the browser performance tools. Saw some reductions in the paint
and script execution time.

Tested that things still rendered correctly on all browsers.

reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        djblets/datagrid/templates/datagrid/listview.html
        djblets/static/djblets/js/datagrid.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        djblets/datagrid/templates/datagrid/listview.html
        djblets/static/djblets/js/datagrid.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.9.x (7a9ec6f)
Loading...