Part of meta issue
Twig as it stands introduces a fair bit of overhead into the theme system. Fabianx indicated that a lot of this is from marking $variables as secure so they're not double escaped later.
Ideally, if Twig autoescape is going to be enabled, then we should just pass raw variables to it and let it do the work. This way, if a template doesn't print the date, or a link, or whatever might currently be check_plain()ed in preprocess, we're not spending all this time creating it for it to be never used. In general, we should be able to remove a large chunk of preprocess work, and just let Twig sort out variables on demand.
Doing this means that a PHPTemplate engine in contrib is going to have to add back a way to securely format variables, but I don't see a way around this if we don't want a serious performance regression.
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 50,650 pass(es), 6,247 fail(s), and 1,419 exception(s).|
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 40,356 pass(es), 12,690 fail(s), and 1,164 exception(s).|
|FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Drupal installation failed.|
|FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: failed to login to test site.|