I'm using a named-pipe WCF service, which has about 1000 methods (yes, I know it's not a good practice, but it's life...).
The problem I got is that when starting up the WCF service, it costs about 10 seconds on constructor of ServiceHost
class. By tracking into it, I found the time is spent on preparing service description (InitializeDescription
method of ServiceHostBase
class). I guess it's because there are too many methods defined in this service contract.
Anyone can help to answer how can I speed up the start up time of this big service contract?
I know it's not a good practice to define so many methods in one service contract. But I can't change the service contract (such as divide it to several smaller ones). You know, this is the real life...
Thanks.
Refactoring this endpoint, while non-trivial, is probably fairly easy to do if you manage the process properly:
Apologies this does not address original question directly and appreciate re-working on this scale may be outside the scope of your current development.