[Mono-dev] Weird performance problems possibly due to floats and precision issues?

Rodrigo Kumpera kumpera at gmail.com
Wed Sep 21 14:34:39 EDT 2011


Hi,

Are you on 32 or 64 bits? Our FP code is quite different on those two.
Can you have a run on .NET without the added denormal hack? We strike to
be as compatible as possible, specially when it comes to numerical stability
and output.


On Wed, Sep 21, 2011 at 10:00 AM, noisecrime <noise at noisecrime.com> wrote:

> Good news, looks like I may have found a solution to the problem.
>
> Though I probably need to do some further testing, it does indeed appear to
> be denormals causing the issue. After reading up on it online its been a
> very common problem for DSP/audio developers and thankfully there appears
> to
> be a simple solution.
>
> This page describes the problem and various solutions
> http://phonophunk.com/articles/pentium4-denormalization.php?pg=3
>
> I went with the simplest
> “On every location in the code where denormalization might occur, just add
> 1.0e-24 to the float value, then subtract it again, that should fix it.”
>
> Doing that in just the lin_solve function such as
>
> x[i+N2J] =  denormal + (( x0[i+N2J] + a * (x[i-1+N2J] + x[i+1+N2J] +
> x[i+N2JN] + x[i+N2JP]) ) * oneOverC);
> x[i+N2J] -=  denormal;
>
> gives constant performance, though I suspect i'll need to add it to a few
> other places in the code as well.
>
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Weird-performance-problems-possibly-due-to-floats-and-precision-issues-tp3829087p3829895.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110921/2c48a4ed/attachment.html 


More information about the Mono-devel-list mailing list