Very slow page load with custom form

Topics: Customizing Orchard, Troubleshooting, Writing modules
Sep 7, 2014 at 3:33 AM
I implemented this complex form using a custom module:

The page loads very slowly (43s) every once in a while. After a slow load, it loads quickly for a while before slowing down again. This is just the page load, so not even submitting the form.

This site is hosted on Azure web sites "shared", and uses Azure media storage for the media library. I am happy with the load times of most other pages, although some of the admin pages are slow to load as well. I have enabled the warm up module on the slow page and others such as the home page, but it didn't help. I don't think this is caused by app pool recycling. I have also tried disabling the dynamic module loader.

Any ideas on how to troubleshoot this?

I've tried bumping up the Azure hosting to the basic and standard levels, and it didn't seem to help.

I'd be happy to share the source code, to see if I did anything blatantly wrong in my implementation that could cause this..
Sep 8, 2014 at 2:16 PM
Running it locally is slow too? If yes, then try profiling (probably the simplest is with this: But before that try this poor man's profiling trick: attach the debugger while the page loads and hit Pause. Execution will most possibly halt in the code that takes most time to run.

The speed-up is probably just because of Output Cache, so when trying locally disable it or log in.