Re: Using CSharpCodeProvider to create MANY assemblies by Nicholas
Nicholas
Mon Nov 26 11:04:53 PST 2007
Sorry, the second "former" should be "latter".
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:%23Mwkj5FMIHA.3976@TK2MSFTNGP03.phx.gbl...
> Brian,
>
> I would say you are probably going to start seeing some issues when you
> try and load 10,000 assemblies into an app-domain. The assemblies
> themselves are small, but the CLR is still going to have overhead in the
> form of assembly, module, and type info for each assembly.
>
> As for your requirement, does it state that you have to have separate
> assemblies, or that you have to be able to call them dynamically (and not
> queue it all up).
>
> If the case is the former, then I would say revisit the requirements.
> What's the justification for generating all those assemblies?
>
> If the case is the former, I would look into creating an in-memory
> assembly, with a single module, and add new global methods/types as needed
> and implementing them using IL, instead of the codedom provider and
> compiling separately.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Bilz" <BrianGenisio@gmail.com> wrote in message
> news:9c89a7d6-08e8-4a8e-a839-d6e53a3a0bb8@y5g2000hsf.googlegroups.com...
>>I am planning to use the CSharpCodeProvider to generate some compiled
>> functions in my app.
>>
>> In my current implementation, All of these functions are generated in
>> one swipe... thus they all invoke the compiler once, and create only
>> one DLL. My new requirement tells me that I need to be more
>> dynamic... that I can't queue up all of these functions... I actually
>> need to do them more on demand.
>>
>> The number of times this happens can be as many as 10,000 times...
>> each with a different calculation. This would mean that I invoke the
>> compiler 10,000 times and create 10,000 in-memory DLLs. This idea
>> scares me... can .NET handle that many DLLs being linked to the app?
>>
>> Does anyone know about the performance overhead of such an endeavor?
>> I am about to write some tests to gather data, but I was wondering if
>> anyone out there has experience with this type of execution. Am I
>> going to run into performance penalties for invoking the compiler that
>> many times? Am I going to run into performance penalties for having
>> that many DLLs in the app domain? If so, are there any workarounds
>> that anyone knows of?
>>
>> Thanks,
>> Brian
>
>