WCF man! It is sooooo slow! and on the local machine!
-
I am writing a N-Tier website with the usual Data Layer/Business Layer/Presentation Layer pattern. It's done up in ASP.NET 4 with VB.NET 4 in VS2010. This is just an intuitive feel; I have no data to back this up. But is it just me, or is a business layer implemented as a WCF service just more slow than if I just implement the business layer as a class library (.dll) instead? Brian
Sincerely Yours, Brian Hart
-
I am writing a N-Tier website with the usual Data Layer/Business Layer/Presentation Layer pattern. It's done up in ASP.NET 4 with VB.NET 4 in VS2010. This is just an intuitive feel; I have no data to back this up. But is it just me, or is a business layer implemented as a WCF service just more slow than if I just implement the business layer as a class library (.dll) instead? Brian
Sincerely Yours, Brian Hart
Brian C Hart wrote:
But is it just me, or is a business layer implemented as a WCF service just more slow than if I just implement the business layer as a class library (.dll) instead?
A WCF service, regardless of the reason for it, is using a network protocol mechanism. If you are comparing that to functionality that doesn't use a network protocol then there will of course be a performance impact. But implicit within that is the following - WCF is a tool not a mandate - One uses a distributed infrastructure based on requirements and architecture needs. It isn't an implementation detail. - Performance is actually a concern. If an app does one txn an hour and the back end processing (not boundary layer) takes one second then performance is irrelevant in the boundary layer. If the app is doing 10,000 a second and the back end processing is taking 0.001 seconds then it might be relevant. But then WCF might in fact be part of the solution in that case. - That in a modern data center setting that network protocol by themselves (ignoring volume entirely and actual business functionality) is going to be a primary performance cost.
-
Brian C Hart wrote:
But is it just me, or is a business layer implemented as a WCF service just more slow than if I just implement the business layer as a class library (.dll) instead?
A WCF service, regardless of the reason for it, is using a network protocol mechanism. If you are comparing that to functionality that doesn't use a network protocol then there will of course be a performance impact. But implicit within that is the following - WCF is a tool not a mandate - One uses a distributed infrastructure based on requirements and architecture needs. It isn't an implementation detail. - Performance is actually a concern. If an app does one txn an hour and the back end processing (not boundary layer) takes one second then performance is irrelevant in the boundary layer. If the app is doing 10,000 a second and the back end processing is taking 0.001 seconds then it might be relevant. But then WCF might in fact be part of the solution in that case. - That in a modern data center setting that network protocol by themselves (ignoring volume entirely and actual business functionality) is going to be a primary performance cost.
We recently (a year ago) had a policy forced on us where the UI could not connect to the database, therefore forcing a service layer, hence WCF. Performance seems to be acceptable but nowhere near as quick as the old winforms. Whenever I get a comment from the users, usually a manager of some type, I point to the policy and raise my hands, "don't talk to me you guys make the rules"
Never underestimate the power of human stupidity RAH