Improve sparse matrix operation