Speed-up minimization by sorting ci