Closed lokeshh closed 7 years ago
Damn that sucks. Need some urgent performance fixes for nmatrix.
@lokeshh Good catch! I think this is due to a lot of heap allocation of SLICE objects, which can be avoided. I will try to have a patch soon.
For #[]=
, I notice that we're spending a lot of time in nm::dense_storage::set()
, allocating and freeing stuff. I'm not going to look into this any more at the moment, just noting this for future reference.
Thanks for looking into this, @wlevine. I concur with your explanation.
I'm using NMatrix for competitive programming for a while now and I have found NMatrix to be slower than Matrix for most of my programs. For example methods such as
[]
,[]=
which are frequently used in my programs are slower in NMatrix.Here's a benchmark I ran and following are the results: