[Mono-dev] Cecil improvement

Jb Evain jb at nurv.fr
Tue Aug 21 11:07:40 EDT 2007


On 8/21/07, Roei Erez <roeie at mainsoft.com> wrote:
> Hi all,
> As you may know we, at mainsoft, use cecil library.
> We have made some analysis for the performance and found that loading
> assemblies with cecil has a lot of memory consuming impact.
> Investigating this thing more had shown that the code creates a full object
> model on top of the assembly row tables.
> We understand that for writing/creating assembly using cecil , building a
> full object model  might be unavoidable, but for a lot of users that only
> wants to read an assembly, and event interested only in part of the assembly
> it might be not necessary.
> We believe that improving this area will give theses users a better
> experience that will be realized in less memory consumption and faster
> loading time.
> Nowadays, we are looking for ways to improve cecil in this area.
> I will be happy to know what you think, and whether you have had thoughts
> about this issue.
> Any thoughts, suggestions and questions are welcome.

I'm also interested in improving Cecil's memory usage, and assembly
load time, as it affects basically every user.

The easier way I can think of right now, to save some memory, is to
discard the Cecil's representation of the table heap after an assembly
is loaded, as it is not need afterwards. But that won't improve the
load time.

A real and full optimization would be to read Cecil's higher level
object model straight from the raw bytes. But that requires quite a
big amount of work. And extra work to keep the assembly writing part

There's also a few people using only the Mono.Cecil.Binary part, to
only read the PE file. So there are quite a few things to take into
consideration before doing anything.

Jb Evain  <jb at nurv.fr>

More information about the Mono-devel-list mailing list