I’m looking for a way to increase .NET application startup time.
Idea is to make a process memory dump right after startup initialization and store it on disk.
On second run it would be nice to replace process memory with that dump and speedup application start.
So, my questions:
- Is there a way to make a dump of .NET process memory?
- Is there a way to restore process memory state from that dump?
- Is solution (if it exists) applicable to IIS-hosted ASP.NET application?
Thanks.
Raw memory dumps don’t really work like that; a lot of things will be handles to things outside that single process, and will explode really badly if you try to replay it. What you need to do is to look at what is causing startup to be slow. For example, if the problem is loading configuration and setup data (say, from a database), then there might be some way to serialize that information so that it can be reloaded from a simple store locally, without as much overhead. You might look at tools like “ilmerge” and “ngen” (which reduce “fusion” and “jit” time, respectively) – but frankly those things are kinda overkill for almost all scenarios.
In the case of IIS: consider a cluster of servers. It doesn’t really matter how long a server takes to start up if it isn’t in the cluster at the time.
But: first measure, then act.