[Mono-dev] [PATCH] String.cs

Andreas Nahr ClassDevelopment at A-SoftTech.com
Tue May 12 03:22:35 EDT 2009



just in case you are interested: Attached is a first try at a managed (and
much more optimized) version of Split. I did lots of the native->managed
transitions in string a while back but never found time to finish this last
one (it failed 2 or 3 testcases in System.Web if I remember correctly).

But maybe if you are interested you can use it as a startingpoint. I don't
have a patch ready but the attached file contains the implementation as-is.

Tests showed (can't find the testapp anymore, but it seems you already wrote
your own) that the implementation is often 10+ times faster than the C




Von: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] Im Auftrag von Phil Garcia
Gesendet: Dienstag, 12. Mai 2009 04:35
An: Atsushi Eno; Mono Development List
Betreff: Re: [Mono-dev] [PATCH] String.cs


Attached is a benchmark program that runs each test case ten million times.
Overall the benchmark for the managed version executes 1.35% faster than the
unmanaged one. Also attached is a chart showing the relative change in
performance for each test case.


I believe this demonstrates that overall the patch does not compromise




On Sun, May 10, 2009 at 9:46 PM, Atsushi Eno
<atsushieno at veritas-vos-liberabit.com> wrote:


That is a nice challenge :)
I had a look at the test you attached, and noticed that it counts
only the time for the entire set of the split operations.
What about the *each* of the cases?

Atsushi Eno

Phil Garcia wrote:

Yes, I have performed some benchmark testing. Attached is a copy of the
benchmark program. It's runs most of the existing test cases for the Split
method in a loop a million times.
 The results between the managed and unmanaged versions are statistically
the same. The unmanaged version seems to be slightly faster by 1.4%. The
unmanaged version was never faster than the managed version in all the
benchmark runs.
 I only have an ESXi virtual environment (running only two guests) to run
the benchmark so my sampling error is higher than if tested on a dedicated
machine. I would appreciate some independent verification, if necessary.
(aka tgiphil on #monodev)

On Wed, May 6, 2009 at 6:35 AM, Rafael Teixeira <monoman at gmail.com
<mailto:monoman at gmail.com>> wrote:

   Do you have some benchmarks comparing the two versions? Although we
   really like the idea of having less-and-less unmanaged code in the
   system class libraries, we need to be sure the solution does not
   affect performance too badly.

   Thanks for your efforts so far,

   On Wed, May 6, 2009 at 7:03 AM, Phil <mono at thinkedge.com

   <mailto:mono at thinkedge.com>> wrote:

       Hi! This is my first submission to Mono.
               The attached patch replaces the unmanaged version of the
       String.InternalSplit() method with a managed
       implementation. This is a direct port from the existing C code
       to C#. I tested this against the 2.0 and 1.1 profiles and there
       were no regressions. This patch is contributed under the X11
               I hope it can be incorporated into Mono.
               BTW. This is the first patch submission from the MOSA Project
       Mono-devel-list mailing list
       Mono-devel-list at lists.ximian.com

       <mailto:Mono-devel-list at lists.ximian.com> 


   --    Rafael "Monoman" Teixeira
   "To be creative means to be in love with life. You can be creative
   only if you love life enough that you want to enhance its beauty,
   you want to bring a little more music to it, a little more poetry to
   it, a little more dance to it."


Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090512/43e2b65d/attachment-0001.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: String-O2.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090512/43e2b65d/attachment-0001.pl 

More information about the Mono-devel-list mailing list