Some of the perf improvements from many-writes-fix branch were accidentally undone in that commit. This puts them back in.