[Mono-dev] [Patch] to significantly shorten Char.cs

Rodrigo Kumpera kumpera at gmail.com
Tue Jul 8 15:33:58 EDT 2008


Hi Andreas,

Sorry for the very long wait, I could only review your patch this week. The
Is* patch is correct and indeed increase performance, please commit it.

Thanks for the contribution,
Rodrigo


On Sun, Jun 29, 2008 at 7:37 PM, Andreas Nahr <
ClassDevelopment at a-softtech.com> wrote:

>  Hi Rodrigo,
>
>
>
> very good suggestion ;)
>
> Attached is a patch that only contains the Is* changes.
>
>
>
> Happy Hacking
>
> Andreas
>
>
>
> *Von:* mono-devel-list-bounces at lists.ximian.com [mailto:
> mono-devel-list-bounces at lists.ximian.com] *Im Auftrag von *Rodrigo Kumpera
> *Gesendet:* Samstag, 28. Juni 2008 00:37
> *An:* Andreas Nahr
> *Cc:* mono-devel
>
> *Betreff:* Re: [Mono-dev] [Patch] to significantly shorten Char.cs
>
>
>
> Andreas,
>
> How about splitting your patches in two? One with the lesser risky
> CheckParameter changes and other with the Is*** changes.
> The CheckParameter changes look lovely, go ahead commit then.
> I would like to do some testing on other changes, that are more comple and
> unfortunately I won't have time until late next week.
>
> I know it's more work on your side, but it makes the review process easier
> for both of us.
>
> Thanks,
> Rodrigo
>
>  On Thu, Jun 26, 2008 at 6:24 PM, Andreas Nahr <
> ClassDevelopment at a-softtech.com> wrote:
>
> Well the main improvement is the shortening of the String-Parameter
> methods.
> It does not affect performance negatively as far as I measured because the
> methods now get inlined but were too large before.
> I know that the code wasn't duplicated for performance reasons before,
> because I actually wrote that code. Well most of Char anyways... ;)
>
> IsWhiteSpace is now somewhat faster. Similar Prog from below (do not have
> the original anymore) went from 21 sec total to 16,5 sec (AMD 3,2Ghz XP)
> (testing one positive + one negative case). It simply saves some opcodes.
>
> public static void Main()
> {
>    int tickCount = Environment.TickCount;
>    for (int i = 0; i < 0x3b9aca00; i++)
>    {
>        char.IsWhiteSpace('v');
>    }
>    Console.WriteLine((int) (Environment.TickCount - tickCount));
>    tickCount = Environment.TickCount;
>    for (int j = 0; j < 0x3b9aca00; j++)
>    {
>        char.IsWhiteSpace(' ');
>    }
>    Console.WriteLine((int) (Environment.TickCount - tickCount));
> }
>
> And no, IsWhiteSpace did not get optimized away ;)
>
> > -----Ursprüngliche Nachricht-----
> > Von: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
> > bounces at lists.ximian.com] Im Auftrag von Atsushi Eno
> > Gesendet: Donnerstag, 26. Juni 2008 23:25
> > An: 'mono-devel'
> > Betreff: Re: [Mono-dev] [Patch] to significantly shorten Char.cs
>
> >
> > I have some comments even without reading your application/octet-stream
> > patch (I ususally don't read them).
> >
> > - Sometimes we have some code pieces that look like duplicates
> >    exactly because of performance improvements.
> > - For performance improvements there should be some benchmark
> >    results with sources.
> >
> > Atsushi Eno
> >
> >
> > Andreas Nahr wrote:
> > > The attached patch reduces code duplication in Char by more than 130
> > lines
> > > and improves the performance of some methods a little bit.
> > >
> > > Somebody please have a short look...
> > >
> > > Happy Hacking
> > > Andreas
> > >
> > >
> > > ---------------------------------------------------------------------
> > ---
> > >
> > > _______________________________________________
> > > Mono-devel-list mailing list
> > > Mono-devel-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> _______________________________________________
> 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/20080708/a56c903f/attachment.html 


More information about the Mono-devel-list mailing list