speedups in sparsity detection