I'm writing a class for calculations with complex numbers because the built in Complex-liberary of VB.NET had flaws i couldn't live with. During performance testing I noticed that my liberary is slower (which is ok, i'm not a genius
). What struck me was that my classes constructor was a lot slower.
On one million cycles it was 10 times slower than the one of the built in complex-class.
My classes constructor looks like this:
Private re As Double
Private im As Double
Public Sub New(Real As Double, Imaginary As Double)
Me.re = Real
Me.im = Imaginary
refreshar = True
refreshmag = True
So there really is not that much going on and still it takes way longer to execute than the one of the built in class.
Does anyone have some pointer on what might be the cause of this?
Thank you in advance, and if you need further infos please ask.