David's perf patches. See README.ahern.