Help - How to speed up Orchard development [builds/refresh are so slow]?

Topics: General, Troubleshooting, Writing modules
Feb 25, 2015 at 3:39 AM
Hey Guys, I'm very new to programming in general, and therefore, a complete novice [hack] when it comes to Orchard. So far I'm finding things pretty difficult with Orchard, but what hinders my learning the most, is the exceptionally long build / loading / debug times? When I can, I always run 'without debugging', but even then, there is a 30s+ delay - and I never leave shape tracing on [as that has a huge impact] and I also only rebuild modules i'm working on at the time.

So basically: how do you guys go about things [to speed things up I mean]; what have you enabled/disabled; what tricks and/or tips have I missed; etc., etc. Anything I could do to shave even a few seconds off would be enormously beneficial.

All your thoughts and opinions greatly appreciated, many thanks Liv.

BTW: I'm using VS2013.4 on a development system that has a 3.2ghz i7 with 12gb ram that runs fine in all other I cant see that being an issue; but perhaps an SSD should be on the shopping list?
Feb 25, 2015 at 8:55 AM
Edited Feb 25, 2015 at 8:57 AM
30 + seconds without debugging seems excessively long. On my computer it always runs within 5 seconds, up and running (lower specs than you described). An SSD would help, but there probably is an issue with your setup.

When debugging, I always run without debugging and then attach the debugger to the process. That's always faster then start with debugging.
Feb 26, 2015 at 8:54 AM
Edited Feb 26, 2015 at 8:55 AM
I'll throw a few ideas around, maybe they'll solve your problem or at least save you a few seconds. Effect not guaranteed :D.
  1. Right click your solution in VS solution explorer > Configuration Manager > Uncheck build next to everything (especially the web site) ... In theory VS is rebuilding everything in your solution every time you start your website which could take a long time.
  2. There may be problem with Visual Studio's web server. Try installing IIS Express (WebMatrix) and run your website there instead and use Visual Studio just to compile your modules, you can attach debugger anytime.
Feb 27, 2015 at 12:26 AM
Agree ^ - also, for my system that I found in the rubble of a paleontologists excavation [...believe me, it was painfully slow], I also did the following-
  • Installed SoftPerfect Ramdisk
  • Created a drive, R: say.
  • Made a batch file to run VS, whilst changing "temp directories" to the Ramdisk.
    here it is:
@echo off
:: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
exit /B
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:: BatchGotAdmin (Run as Admin code ends)
:: Your codes should start from the following line
set TEMP=R:\vstemp
set TMP=R:\vstemp
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
The last three lines are all that matters - the rest is to run it in Admin mode which I sourced of the net [cant remember whom sorry], which you can just do by right clicking obviously [if you do jut use the last 3 lines, that is.]
  • Changed Resharper "caches" to system TEMP folder [ramdisk], if you're using it - if not, you should be ;)...Also, there was a huge speed increase from Resharper 8 - 9.
This seriously increased load / builds, especially once the drive is populated, thereafer - nice and snappy. But your sys should be good [in spec], but it doesnt hurt to give it a try ;) Good luck, cheers Dyr
Feb 27, 2015 at 1:37 AM
WOW!!!! Thank you so much guys :) I incorporated basically everything you said, and now, it's honestly like a new system!
dyrgutt: haha - your system sounds awesome ;) what size did you make your Ramdrive, I did 2.5gb? Loading the projects and resharper intialization is done in 4-7s, instead of a 30s+ to a minute or so :) :) and my F5's without debug went down to 5s, YAY!!!
Xeevis: Then, when i disabled the builds like you said - it's now 1s max -- whoah! AMAZING!!
sanderg: Definitely doing the attach method, as even after all the above, F5 with debugging still takes around 45s, so is that just an Orchard thing with the amount of projects, or is my system not quite right?

I have to say, truly love the orchard community, big love and tremendous thanks to you all - Liv
Feb 27, 2015 at 1:50 AM
Feb 27, 2015 at 8:12 AM
@dyrgutt Very cool. This is deserving of a blog post for future reference.
Mar 1, 2015 at 6:52 PM
Edited Mar 1, 2015 at 6:53 PM
Something that made my developing experience a real pain was this issue with dynamic ImageProfiles after solving it things starting to work pretty well. So if you are using dynamic ImageProfiles try the solution I propose in the issue, it worked to me.