[Mono-dev] Question about performance improvement in C#

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Apr 16 10:34:38 EDT 2006

Em Dom, 2006-04-16 às 07:18 -0700, Rusmin Susanto escreveu:
> What should I do to bring the performance closer to C (of course I wan
> to keep the class and operators)?

AFAIK the "+" operator always works on pairs, so you would need to
create a method. 

I'd suggest creating a class method like

static MyArray Sum(MyArray[] arrays) {
    MyArray result = MyArray(get_size_from_other_array);
    return result;


 A = (B + C + D + E + F)/2.5;

would become 

 A = MyArray.Sum(new MyArray[] {B, C, D, E, F})/2.5;

Yes, I know, it's uglier.



More information about the Mono-devel-list mailing list