Massively speed up datagrid rendering.

Review Request #4030 — Created April 7, 2013 and submitted

Information

Djblets
master

Reviewers

Massively speed up datagrid rendering.

While investigating a slowdown with the new RBCommons deployment, I
realized we were creating a RequestContext over and over again. Once for
every rendered cell. It was excessive.

I've changed it to only create one RequestContext per request, total,
and to reuse those values for any new contexts used when rendering a
cell.

Prior to this, our weirdly slow RBCommons datagrid rendering on the new
instance was hovering around 6 seconds. After, it was at just around 1
second without any cached queries, and 0.5 seconds after.

While we still need to track down what's going on on that instance, I
can say that our datagrid rendering has never been faster.
Tested locally, and pages loaded instantaneously.

Deployed on RBCommons, and pages were *much* faster, especially once
queries were cached.

Unit tests pass.
Description From Last Updated

Col: 5 E303 too many blank lines (2)

reviewbotreviewbot

Can you document this?

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/datagrid/grids.py
      Ignored Files:
    
    
  2. djblets/datagrid/grids.py (Diff revision 1)
     
     
    Show all issues
    Col: 5
     E303 too many blank lines (2)
    
  3. 
      
david
  1. 
      
  2. djblets/datagrid/grids.py (Diff revision 1)
     
     
    Show all issues
    Can you document this?
  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/datagrid/grids.py
      Ignored Files:
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (1c2ef8a)