BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Comparing WCF Performance to ASP.NET Core

Comparing WCF Performance to ASP.NET Core

Leia em Português

This item in japanese

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

BT