Build precompiled version and turn off dynamic compilation?

Topics: Installing Orchard
Jul 7, 2013 at 2:36 AM
How much of a performance boost is there with turning off dynamic compilation as per cloudconstruct:
Build a precompiled version of your site so you can turn off dynamic compilation. This one is something I did not realize I could do. Basically, you will want to build the Orchard source code using the "build /t:precompile" flag. You need to add all your modules to the Orchard solution so they get built as well. Once you perform this build, you will have a new folder under build/MsDeploy. You will notice all of your modules have their dll's built in their bin folders. The final step is to rename the SampleHostComponents.config to HostComponents.config inside the Orchard/Config folder of the website folder. This tells Orchard to stop looking to dynamically compile the modules. This should shave some processing time off of your site.
Jul 7, 2013 at 11:06 AM
Hard to say, that depends. You would need to compare both in your environment to get real numbers. The boost comes from turning file monitoring off.
Jul 7, 2013 at 11:15 AM
Is the biggest downside of turning off dynamic compilation that I would have to recompile each time i add a module?
Jul 7, 2013 at 12:09 PM
Edited Jul 7, 2013 at 12:09 PM
No, turning dynamic compilation off means that every module you add needs to be compiled upfront (contain compiled dlls in /bin folder). Adding a module with source files only will have no effect (thus most modules from the gallery won't work out of the box).

You don't have to recompile the whole application, just the module.