eregs/regulations-site — pull request #610 by cmc333333 (2014-02-28 07:03:26+00:00)
Title: Speed up pages with many interpretations

A while ago, we loaded all interps intro memory when rendering a section -- the idea being that this would pre-cache the interps once rather than making a request per interp tree. That feature was lost at some point, but more importantly, some reg interpretations are too large for this strategy. By the time the last node is entered into the cache, the first of the interpretations has already been pushed out.

This pull request solves that problem by adding an optional preprocessing step when applying a "paragraph"-style layer. Interpretations then use that step to pre-fetch interpretations for their subtree (e.g. for a whole section). This is a much smaller number, so works well.

I'd certainly be willing to swap out the `hasattr` check with a "paragraph" layer base class if that seems important.