theodi/open-data-certificate — pull request #418 by benfoxall (2013-07-26 12:38:08+00:00)
Title: Questionnaire performance

These are some tweaks for displaying the questionnaire:

* loading in relations better to avoid re-instantiating some models
* caching a part of the translations lookup on the survey

Locally - it reduces db queries on the page by about 2/3rds and reduces the render time by about 1/2.

We're also caching the entire questionnaire against the response set efe97f81713fbf7353674ef20090b4aff429f4df - so if you reload it without changing responses it will be super fast, this seems to be pretty solid - though it could do with some testing

(Not implemented) each question may be further cached in a [russian doll](http://edgeguides.rubyonrails.org/caching_with_rails.html#highlighter_35888) style, though there might be an overhead if the rails cache doesn't use a batch-get from memcached