laravel/laravel — pull request #1177 by thybag (2012-09-04 15:52:04+00:00)
Title: Performance fix 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