Backout 86b5cb334b73 and db7cbf61b001 (bug 810718, parts 1 and 2) for multiple perf regressions.

--HG--
extra : rebase_source : c20c81d0cf47b607815c0592d748d4f0a430d430