symfony/symfony — pull request #7812 by bschussek (2013-04-23 11:43:46+00:00)
Title: [FrameworkBundle] Improved TemplateNameParser performance

| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -

Performance test in symfony-standard:
```php
boot();
$parser = new TemplateNameParser($kernel);

$time = microtime(true);

for ($i = 0; $i < 50; ++$i) {
$parser->parse("AcmeDemoBundle:Foo:bar$i.html.twig");
}

echo "Time: " . (microtime(true) - $time)*1000 . "ms\n";
echo "Memory: " . memory_get_peak_usage(true)/(1024*1024) . "MB\n";
```

Before:
```
Time: 3.80706787109ms
Memory: 1.5MB
```

After:
```
Time: 3.13401222229ms
Memory: 1.5MB
```