more speedups in sparsity detection