Performance issues

View: New views
2 Messages — Rating Filter:   Alert me  

Performance issues

by izik.shmulewitz@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
I'm having some performance issues with Cecil and I'm wondering if I'm
missing something with the usage guidelines.
I'm writing a code analysis tool and decided to try to replace my
reflection parts with Cecil. When I used reflection I loaded an
assembly into the app domain and from that point on i could have
accessed any reflected data from that assembly with relatively good
performance (meets my requierments). when i try working with Cecil i
encountered the following problem, loading an AssemblyDefinition takes
a lot of time (300 ms for some of the BCL assemblies), so i can't
request Cecil to load one every time i need to access some property
from the reflected type. On the other hand if i cache the
AssemblyDefinitions I'm using I get an OutOfMemoryException (I can get
to a point where I'm loading the whole BCL). So I tried to look around
and check if there's any way to quickly load only the types i need.

Is there any other entry point to the data instead of
AssemblyDefinition ?
Is there any way to load single TypeDefinition ?
Is there any way to load part of an assembly ?

Thanks in advance,
izik shmulewitz.

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: Performance issues

by Jb Evain-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The current version of Cecil is definitely a big memory hungry, but if
you use it wisely, and only keep one AssemblyDefinition around for
each assembly, you should not really have troubles.

It's not possible right now to delay load assemblies or read partially
assemblies, but the next version of Cecil will allow it.

On 9/30/09, izik.shmulewitz@... <izik.shmulewitz@...> wrote:

>
>  Hi,
>  I'm having some performance issues with Cecil and I'm wondering if I'm
>  missing something with the usage guidelines.
>  I'm writing a code analysis tool and decided to try to replace my
>  reflection parts with Cecil. When I used reflection I loaded an
>  assembly into the app domain and from that point on i could have
>  accessed any reflected data from that assembly with relatively good
>  performance (meets my requierments). when i try working with Cecil i
>  encountered the following problem, loading an AssemblyDefinition takes
>  a lot of time (300 ms for some of the BCL assemblies), so i can't
>  request Cecil to load one every time i need to access some property
>  from the reflected type. On the other hand if i cache the
>  AssemblyDefinitions I'm using I get an OutOfMemoryException (I can get
>  to a point where I'm loading the whole BCL). So I tried to look around
>  and check if there's any way to quickly load only the types i need.
>
>  Is there any other entry point to the data instead of
>  AssemblyDefinition ?
>  Is there any way to load single TypeDefinition ?
>  Is there any way to load part of an assembly ?
>
>  Thanks in advance,
>  izik shmulewitz.
>
>  >
>


--
Jb Evain  <jb@...>

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---