Performance improvements and config options

This PR aggregates several different kinds of general performance improvements, plus config options to disable some more expensive tracking choices. It's extracted from https://github.com/ceph/ceph/pull/1133.