From: Fabien Potencier Date: Tue, 7 May 2013 18:41:16 +0000 (+0200) Subject: merged branch Seldaek/optim (PR #1077) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=d441ad7c672daae7ed765c6d9a77e719af4418b0;p=web%2Fkonrad%2Ftwig.git merged branch Seldaek/optim (PR #1077) This PR was merged into the master branch. Discussion ---------- Some more optimizations Please look at commits one by one. Overall this makes the twig_escape_filter almost 20% faster here for happy path (escaping string for html with UTF-8) on 1000 calls. Still pretty darn slow, but faster. Commits ------- d886b12 Make happy path (strings) faster by avoiding the cast, same perfs for the other cases 97bf5e5 Avoid unnecessary is_object call c1c0dcc Use uppercased charsets consistently (as in js/css/html_attr strategies) a23fa62 Add UTF-8 in uppercase since it is so common c891c53 Avoid strtolower call at every twig_escape_filter call 61f2b2a Use plain string comparison which is twice as fast d4eec01 Move html case up since it is the most likely to be hit --- d441ad7c672daae7ed765c6d9a77e719af4418b0