# Performance increase using structs instead of classes?

Hi,

First, congratulations for this ongoing work! I came to Math.Net after attempting to create my own libraries, so here is an idea which my be of a help.

The idea would be to use Structs to define matrices instead of Classes to improve performance.

As mentioned above, I did a check with a homemade matrix class and another one being a matrix struct, and for matrices up to 5000X5000 structs are circa 10 times faster for matrix multiplication.

I compared Math.Net with MKL against matlab and it appears to be circa 2 times slower for such matrix sizes. This gives some hope that using structs might bring execution times similar to matlab.

**21**votes