laravel/laravel — pull request #1180 by thybag (2012-09-04 17:25:31+00:00)
Title: Performance enhancement for HTML Class.

Hello,

We've recently started using laravel for a number of internal web-apps, but have run in to a couple of issues when load testing. The underlying issue being that the config::get method is significantly more expensive than a standard array access. This is compounded by it being invoked a 100-1000 times per page load.

This pull request includes a change we've made to attempt to mitigate this issue, which functions by caching the application.encoding variable within the HTML class. To use one of our apps as an example, for a large form this reduced the number of calls to config::get from 1200+ invocations (72ms) to 125 (9ms).

All core unit-test's pass with this change in place.

Thank you,
Carl

Note: I originally targeted the wrong branch with my pull request ( https://github.com/laravel/laravel/pull/1177 ) so have closed it and opened this one instead. Sorry for the inconvenience.