Well, we have run our internal tests, and also the profiler, and changing 
this code gains 20%, so it doesn't seem to be doing exactly the same. The 
"old" code running through the switch several times, and creating an 
encoding object thousands of times too.

Our tests run our Plastic SCM system for about 20 minutes, and 20% was lost 
there.

pablo


----- Original Message ----- 
From: "Dean Harding" <[EMAIL PROTECTED]>
To: "'For users and developers of the Firebird .NET providers'" 
<[email protected]>; "'Carlos Guzmán Álvarez'" 
<[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2007 1:38 AM
Subject: Re: [Firebird-net-provider] Big performance gain on Charset.cs


>> AFAIK you don't create more objects. Is exactly the same, the difference
>> is that instead of making thousands of calls to GetEncoding , and going
>> several times through the switch statement, you just do it once... We
>> didn't detect a hit on memory consumption (I will double check), but
>> peformance hit is great!
>
> I'm not sure about the CF, but in the normal framework, once you create an
> Encoding object, it is cached in a hashtable anyway (that's what it does
> looking at Encoding.GetEncoding in Reflector). So every call to
> Encoding.GetEncoding with the same codepage will get the exact same 
> instance
> anyway.
>
> So, at least for the normal framework, doing it once in the constructor is
> the same as doing it each time it is used (in terms of the behavior).
>
> Dean.
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Firebird-net-provider mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to