Hello,
First, some stupid Math calculations:
>
> for (int ct = 0; ct < 1000000; ct++)
> {
> decimal d =
> Convert.ToDecimal(Math.Pow(ct, 4));
> d =
> Convert.ToDecimal(Math.Sqrt(Convert.ToDouble(d)) * 4 *
> Math.Atan(Convert.ToDouble(ct)));
> }
>
I looked a little bit into this, and although the above looks
computationally intensive, in Mono the above goes through vast paths of GC
bound operations as our implementation for the Decimal (double) sadly goes
through a very inefficient code path. It allocates strings, formats
strings and does a bunch of extra work.
We probably should implement a Decimal constructor that decodes
double/floats directly.
On a separate note, we have regressed somewhere in trunk compared to 2.6.1.
I include my sample.
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list