merged branch Cottser/master (PR #1071)
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 4 Aug 2013 13:05:27 +0000 (15:05 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 4 Aug 2013 13:05:27 +0000 (15:05 +0200)
commit2f5c9899a4088fce3bb6325d96232cd1978161e4
tree5a215a66c04d1e7a38a969d116a0b1ed73547eb5
parent4e7094f6a3831dc86b4963d805c4567f4076fce3
parent4ae5385d438b84358d307980b8032f737c697df5
merged branch Cottser/master (PR #1071)

This PR was merged into the master branch.

Discussion
----------

Add static caching for Twig_Environment::getTemplateClass()

Coming from http://drupal.org/node/1979290.

```
=== baseline-views-field-twig..views-field-twig-static-cache compared (517896dc57c6e..5178989df1d0f):

ct  : 116,895|115,892|-1,003|-0.9%
wt  : 478,367|474,349|-4,018|-0.8%
cpu : 449,530|444,639|-4,891|-1.1%
mu  : 17,447,208|17,453,200|5,992|0.0%
pmu : 17,658,176|17,664,136|5,960|0.0%
```

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=517896dc57c6e&run2=5178989df1d0f&source=drupal-perf-cottser&extra=baseline-views-field-twig..views-field-twig-static-cache

We found that performance could be measurably improved when the same template is rendered multiple times in a request.

Commits
-------

4ae5385 Add static caching for Twig_Environment::getTemplateClass()
lib/Twig/Environment.php