[Mono-dev] System.Decimal performance

Leszek Ciesielski skolima at gmail.com
Wed Jun 4 08:59:49 EDT 2008


On Mon, Jun 2, 2008 at 11:40 PM, Zoltan Varga <vargaz at gmail.com> wrote:
> Those are now fixed in SVN.
>
>        Zoltan
>
> On Mon, Jun 2, 2008 at 10:53 PM, Andreas Nahr
> <ClassDevelopment at a-softtech.com> wrote:
>> There are massive regressions in System.Data that seem to come from the
>> changes in decimal.c
>>
>> Andreas
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
>>> bounces at lists.ximian.com] Im Auftrag von Zoltan Varga
>>> Gesendet: Montag, 2. Juni 2008 22:15
>>> An: Leszek Ciesielski
>>> Cc: mono-devel-list
>>> Betreff: Re: [Mono-dev] System.Decimal performance
>>>
>>>                  Hi,
>>>
>>>   The next mono release (2.0) will have better decimal performance,
>>> especially
>>> when doing divisions.
>>>
>>>                     Zoltan
>>>
>>> 2008/5/29 Leszek Ciesielski <skolima at gmail.com>:
>>> > Hi,
>>> >
>>> > the company I work for builds finance-related software, so we use the
>>> > Decimal type a lot. And in any computation-heavy program we find that
>>> > the Mono implementation of the decimal type... well... let's just say
>>> > it's not on par with MS.Net performance ;-) . Addition, substraction
>>> > and multiplication lag a bit (2-4 times slower). However, division is
>>> > at least 10 times slower, in some cases even 50x! I don't have any
>>> > complex tests at hand right now, but a simple performance-measuring
>>> > program is attached to the mail. There's also a java version
>>> (although
>>> > BigDecimal is not a simple equivalent of System.Decimal as it has no
>>> > upper bound on available precision). From my simple test the results
>>> > are as follows:
>>> >
>>> > MS.Net 3.5
>>> > addition 2375 ms : 2354,156132
>>> > substraction 2140,625 ms : 2337,043868
>>> > multiplication 1734,375 ms : 189,08461995264
>>> > division 8468,75 ms : 29097,233616240416508043573961
>>> >
>>> > Mono 1.9 Windows 2.0 profile
>>> > addition 4812 ms : 2354,156132
>>> > substraction 4781 ms : 2337,043868
>>> > multiplication 3407 ms : 189,08461995264
>>> > division 61390 ms : 29097,233616240416508043573961
>>> >
>>> > Mono svn-linux 2.0 profile
>>> > addition 4201.837 ms : 2354.156132
>>> > substraction 4413.458 ms : 2337.043868
>>> > multiplication 4489.036 ms : 189.08461995264
>>> > division 61303.573 ms : 29097.233616240416508043573961
>>> >
>>> > Java 1.6.0_06
>>> > addition 4640 ms : 2354.156132
>>> > substraction 3969 ms : 2337.043868
>>> > multiplication 2219 ms : 189.08461995264
>>> > division 33376 ms : 29097.233616240416508043573961
>>> >
>>> > Has anyone done any performance tunining with the decimal type?

Same machine as before:

Mono 1.9.1 linux 2.0 profile
addition 4262.454 ms : 2354.156132
substraction 4274.603 ms : 2337.043868
multiplication 4194.232 ms : 189.08461995264
division 55155.252 ms : 29097.233616240416508043573961
(no changes, just a reference run)

Mono /trunk/ r104850 linux 2.0 profile
addition 3263.994 ms : 2354.156132
substraction 3225.994 ms : 2337.043868
multiplication 3725.557 ms : 189.08461995264
division 15559.139 ms : 29097.233616240416508043573961

Those are impressive speedups :-) MS.Net is still faster, but at least
now wer'e in the same league ;-)


More information about the Mono-devel-list mailing list