BT

InfoQ Homepage News Comparing WCF Performance to ASP.NET Core

Comparing WCF Performance to ASP.NET Core

Bookmarks

Microsoft has invested a lot time and developer energy into the development of ASP.NET Core.  The result is an open platform where new features debut and benefit from open engagement with the broader developer community.  One would expect to find that ASP.NET Core has better performance than older technologies like Windows Communication Foundation (WCF).  Recently it appeared that was not the case, so let’s take a deeper look.

Developer Erik Heemskerk recently published an article describing his investigation into the performance of ASP.NET Core versus WCF.  In his experiment, he wrote a simple project that used each technology to "stand up a local web server, measure how long it takes to create a request, send it, deserialize it, generate a response, send that back, and deserialize the response."

Much to his surprise, WCF was roughly 1/3 faster than the equivalent ASP.NET Core project when the payload is a simple GUID.  Realizing that the difference may be due to WCF serializing to XML while ASP.NET Core is using JSON, Heemskerk forced ASP.NET Core to serialize to XML.  This resulted in an improvement, but WCF remained much faster.  To try a different approach, Heemskerk then increased the payload to a more realistic object size and used MessagePack with ASP.NET Core.  Here at last ASP.NET was slightly faster than WCF.

But the story doesn’t end there.  Developer Josh Bartley then examined Heemskerk’s work to see what other changes may be made to improve the results for ASP.NET.  His analysis indicated that perhaps the benchmarking for ASP.NET was not including the exact same work when compared to the work of the WCF code.

So ASP.NET Core is not a step backwards in performance.  If initial performance does not meet expectations, some analysis may be required to tune for best performance.  The bigger lesson when trying to improve performance is to ensure the right area is selected for benchmarking so that right pieces of code are improved.

 

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • WCF is 3 times faster, not 1/3 faster.

    by Xiaoguo Ge /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    METHOD MEAN
    Wcf 830,1 μs
    WebApi 2614,2 μs

  • Protocol?

    by Timothy Liu /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    What's the protocol between the WCF service and the WCF client? ASP.NET Core is built on HTTP. It's unfair to let people who's in sportswear race with people who's in wetsuit, is it?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.