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]]: [MySQL] Failed to run tests: failed to login to test site.|
|FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.|
|FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.|