Build precompiled version and turn off dynamic compilation?

Topics: Installing Orchard
Jul 7, 2013 at 3: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.
Developer
Jul 7, 2013 at 12:06 PM
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 12:15 PM
Is the biggest downside of turning off dynamic compilation that I would have to recompile each time i add a module?
Developer
Jul 7, 2013 at 1:09 PM
Edited Jul 7, 2013 at 1: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.