Home All Groups Group Topic Archive Search About

CLR keeps on probing for XmlSerializers assembly

Author
31 May 2006 3:32 PM
Vagif Abilov
I noticed that components that use XmlSerializer class cause CLR to probe
for XmlSerializers assembly. Is this default behavior, i.e. whenever
component try to serialize/deserialize one of its classes, CLR will search
for pre-compiled serializer? If so, can I simply use SGEN tool to generate
such assembly and CLR will automatically use it? And will it really give a
significant performance advantage?

Thanks in advance
Vagif Abilov
Oslo Norway

Author
2 Jun 2006 3:38 PM
Ben Voigt
"Vagif Abilov" <va***@online.no> wrote in message
news:%23j14kdMhGHA.1320@TK2MSFTNGP04.phx.gbl...
>I noticed that components that use XmlSerializer class cause CLR to probe
>for XmlSerializers assembly. Is this default behavior, i.e. whenever
>component try to serialize/deserialize one of its classes, CLR will search
>for pre-compiled serializer? If so, can I simply use SGEN tool to generate
>such assembly and CLR will automatically use it? And will it really give a
>significant performance advantage?

The cost of generating the serializer is substantial (since Reflection.Emit
is quite heavy-duty), however the ongoing performance should be equal since
I believe it's the same code used for pre-compiling and on-the-fly, and that
the on-the-fly serialization assembly is cached for the lifetime of the
appdomain.

Show quote
>
> Thanks in advance
> Vagif Abilov
> Oslo Norway
>
Author
4 Jun 2006 12:31 PM
Vagif Abilov
Thanks, so this means once generated it will be kept as long as AppDomain
lives. Then we will probably afford online generation.

Vagif

Show quote
"Ben Voigt" <rbv@nospam.nospam> wrote in message
news:uHOsJqlhGHA.4080@TK2MSFTNGP03.phx.gbl...
> "Vagif Abilov" <va***@online.no> wrote in message
> news:%23j14kdMhGHA.1320@TK2MSFTNGP04.phx.gbl...
>>I noticed that components that use XmlSerializer class cause CLR to probe
>>for XmlSerializers assembly. Is this default behavior, i.e. whenever
>>component try to serialize/deserialize one of its classes, CLR will search
>>for pre-compiled serializer? If so, can I simply use SGEN tool to generate
>>such assembly and CLR will automatically use it? And will it really give a
>>significant performance advantage?
>
> The cost of generating the serializer is substantial (since
> Reflection.Emit is quite heavy-duty), however the ongoing performance
> should be equal since I believe it's the same code used for pre-compiling
> and on-the-fly, and that the on-the-fly serialization assembly is cached
> for the lifetime of the appdomain.
>
>>
>> Thanks in advance
>> Vagif Abilov
>> Oslo Norway
>>
>
>

AddThis Social Bookmark Button