jeudi 24 mars 2016

Performance for Activator.CreateInstance

I am invoking a method using the following lines of code. Loading the assembly dynamically and executing a method in a class dynamically:

var myModule = Activator.CreateInstance(mytype, true);

MethodInfo myMethodInfo = mytype.GetMethod("Run");
object[] mParam = new object[] { param };
myMethodInfo.Invoke(myModule, mParam);

Is it going to hamper performance considerably. If it is low on performance, is there any other way to make it perform the best retaining the dynamic calling of executing the object?

Thanks





Aucun commentaire:

Enregistrer un commentaire