I’m fighting for my ASP.NET application startup time. It was around 7 seconds with vanilla ASP.NET MVC 4 + Razor, now I’ve rewritten it based on Nancy + Razor and I got 3 seconds gain in loading time. And I’m wondering, can I go further by replacing Razor with something else?
Does anybody have any insights which template language present in Nancy will let me win couple seconds?
- Spark,
- NDjango, based on Django syntax,
- DotLiquid, based on Liquid markup,
- Nustache — clone Mustache.
EDIT: I care about startup time, since cloud services like Azure Websites and App Harbor shut down your application if nobody accessed it for 30 seconds or so (it depends on IIS configuration). Since I don’t have a very popular application almost every user waits for about 7 seconds for nothing.
Another approach could also be used — warming-up my ASP.NET application. But it is not possible in the ‘free of charge’ cloud publishing options for .NET, so I got to search for workarounds.
Ok, if it’s app startup time you’re worried about then something that doesn’t invoke CSC is going to be the fastest (like SSVE), but you’ll lose a lot of features too.
Other speedups you can make would be to turn off autoregister (if you use the default bootstrapper) and change anything in the bootstrapper / internalconfiguration that uses the type scanner to return a specific set of types – you lose flexibility, but you will gain startup speed.
Another option would be to use a site monitor service (sure there are free ones) to “ping” your site every now and then to stop it killing it 🙂