[Mono-dev] System.Reflection.Assembly::Load Performance?

Babbage Linden babbage at lindenlab.com
Wed Dec 9 09:00:53 EST 2009


2009/12/1 Zoltan Varga <vargaz at gmail.com>

> Hi,
>
>   It is possible that you are using AppDomain.AssemblyLoad which is called
> every time an
> assembly is loaded ? Or a profiler callback ?
>
>
The code I'm using for loading is:

public Script(string class_name, byte[] class_data,
                      ref long event_handlers)
{
            Init();
            Assembly assembly = Assembly.Load(class_data);
            foreach (Type NewType in assembly.GetTypes())
            {
                if (NewType.IsSubclassOf(typeof(UserScript)))
                {
                    UserScript userScript =
                        (UserScript)assembly.CreateInstance(
                            NewType.ToString());

                    SetUser(userScript, ref event_handlers);
                    return;
                }
            }
}

It's the Assembly.Load(class_data) call that is taking the time.

Cheers,

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091209/bd695146/attachment.html 


More information about the Mono-devel-list mailing list