5

Does anyone know if there are performance benefits from using the WebAPI rather than just using an MVC controller which returns JSON?

UpTheCreek
  • 31,444
  • 34
  • 152
  • 221
  • ajax request sent to mvc controllers are quite fast, faster would be zero miliseconds – Omu Mar 10 '12 at 10:47
  • @Chuck Norris - Well in my opinion there's a lot of stuff that 'spins up' when you make a request via the ASP.NET pipeline. Even very fast response times add up when scaling. – UpTheCreek Mar 10 '12 at 13:25

1 Answers1

3

I think the benefits are more related to flexibility than performance. You can implement a rest service using the MVC way, but the Web API provides a cleaner model: the actions are implicit in the HTTP verbs, the content can be delivered both in JSON and XML, there is native support to return an IQueryable< T > (this can be seen as a small performance improvement), and it can be integrated with an ASP.NET Web Forms application (or even a console app, with no ASP.NET at all).

Henrique Baggio
  • 346
  • 3
  • 5