Stache performance improvements for #1011