optimized sparse matrix reading