merged branch dlsniper/loader-exception-improvement (PR #841)
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 19 Oct 2012 12:27:33 +0000 (14:27 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 19 Oct 2012 12:27:33 +0000 (14:27 +0200)
commited0554610a358fab62a10f9dbb26dad6d34faadb
tree313597b37dfc52157890369270719cf1bdb66b04
parentaf1bfe95166946631160a0cbcf9a20963bb1be5e
parent08ecb0e1c418c75b3dc50fe3894251529f2bc523
merged branch dlsniper/loader-exception-improvement (PR #841)

This PR was squashed before being merged into the master branch (closes #841).

Commits
-------

08ecb0e Improvements for loader speeds

Discussion
----------

Improvements for loader speeds

This is something started from #822 .

It attempts to improve the speed of the chain loader and rest of the standard loaders by adding a cache level and a ```hasSource()``` method for them in order gain speed.

---------------------------------------------------------------------------

by dlsniper at 2012-09-27T14:56:24Z

Thanks for the feedback, I'll do the changes tonight or during the coming weekend.

As for the utility of the ```::setExtendedErrorHandling()``` function, this saves me about 25% to 40% on the benchkmark Fabien presented in the original ticket.

Thanks!

---------------------------------------------------------------------------

by dlsniper at 2012-09-29T11:34:59Z

I've added some caching for the Chain Loader but it's still a WIP. I'll work more on this in the coming hours.

---------------------------------------------------------------------------

by dlsniper at 2012-09-29T23:10:10Z

I'm getting better values right now that I had before, standing on:
```
0.09
0.07 ... x 1
0.07 ... x 1
```
I've also noticed that if I run the tests from the browser then I'll have an overall slowdown of about 0.10 which I'm not sure from where it comes from. Any pointers before me digging a bit more into Twigs internals.

---------------------------------------------------------------------------

by dlsniper at 2012-10-03T21:31:15Z

@fabpot what's your opinion about this PR?

---------------------------------------------------------------------------

by dlsniper at 2012-10-14T18:26:13Z

@Tobion and @fabpot done and done :)

I'm not sure why the tests are failing on PHP 5.4 as I don't have it installed anywhere.
lib/Twig/Error.php
lib/Twig/Loader/Filesystem.php