Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
6 changed files
with
127 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Twig. | ||
* | ||
* (c) 2009 Fabien Potencier | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* Interface all loaders must implement in order to provide extra functionality | ||
* for the Twig core. | ||
* | ||
* @package twig | ||
* @author Florin Patan <florinpatan@gmail.com> | ||
*/ | ||
interface Twig_ExtendedLoaderInterface | ||
{ | ||
|
||
/** | ||
* Check if we have the source code of a template, given its name. | ||
* | ||
* @param string $name The name of the template to check if we can load | ||
* | ||
* @return boolean If the template source code is handled by this loader or not | ||
*/ | ||
public function exists($name); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters