[Mono-devel-list] Improved NumberFormatter
Kazuki Oikawa
kazuki at panicode.com
Mon Feb 21 20:28:15 EST 2005
On Mon, 21 Feb 2005 16:31:21 +0100
Paolo Molaro <lupus at ximian.com> wrote:
> On 02/21/05 Kazuki Oikawa wrote:
> > I improved NumberFormatter and improved performance and memory usage
> > when integer standard format.
>
> If you have numbers, please post them.
int.ToString ("C")
Old : 18900000 [147091 KB]
New : 8750000 [ 96090 KB]
int.ToString ("D")
Old : 10630000 [84810 KB]
New : 5940000 [51604 KB]
int.ToString ("E")
Old : 37810000 [413557 KB]
New : 8280000 [ 59041 KB]
int.ToString ("F")
Old : 14370000 [147093 KB]
New : 6720000 [ 53557 KB]
int.ToString ("G")
Old : 12180000 [111069 KB]
New : 6400000 [ 88496 KB]
int.ToString ("N")
Old : 19840000 [157834 KB]
New : 8280000 [ 73631 KB]
int.ToString ("X")
Old : 21880000 [134478 KB]
New : 8910000 [ 61233 KB]
using code:
static void Main ()
{
DateTime dt = DateTime.Now;
for (int i = 0; i < 500000; i++)
i.ToString (); //c,d,e,f,n,x
Console.WriteLine (DateTime.Now.Subtract (dt).Ticks);
}
>
> > When this patch is applied, some wrappers in NumberFormatter.cs,
> > DoubleFormatter.cs and SingleFormatter.cs are unnecessary.
>
> Please also submit a patch to remove the now-useless stuff.
>
> > Additionally, I attached NumberFomatter which I improved.
>
> Post the changes in diff format.
>
> > Please review it.
>
> And do not compress them: you should also configure your mail
> program to send text files as text files, instead of
> application/octet-stream.
Sorry...
Reattached patches. Is this OK?
Best regards.
Kazuki Oikawa
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: System.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050222/9242fe6d/attachment.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NumberFormatter.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050222/9242fe6d/attachment-0001.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: corlib.dll.sources.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050222/9242fe6d/attachment-0002.pl
More information about the Mono-devel-list
mailing list