Some performance improvements when sampling dimensions