matrix on cpu side, speed profiling