Partially revert r210444 due to performance regression