MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

How programmers can improve the Asp.net web API performance

Published on 30 October 14
1595
1
1
Itâs not tough for a .net programmer to write web API; thanks to the technology. They donât need time investment for structuring high-performing applications. Here in this post, Aegis professionals will going to share some techniques to enhance asp.net Web API performance, so that the global community of asp .net development and the app users can make maximum use of apps.

  • Fastest JSON serializer use

The overall performance of Asp.net Web API can be affected by JSON serialization in significant manner. .Net programmers can measure approx 20% improvement on their Web API responses. Experts recommend this serializer to get high-performing solution.

How programmers can improve the Asp.net web API performance - Image 1
  • Creating JSON string from DataReader
Making things easy for app development, .net programmers can manually create JSON string using DataReader instead of reading values from it and developing JSON from Serializer. This will eliminate unwanted objects development and give least complications during programming. Developers can use StringBuilder to create JSON and return StringContent as the Web API response content.
How programmers can improve the Asp.net web API performance - Image 2
  • Using other formats like message pack, protocol buffer whenever possible

If you have other formats than JSON then go for it. Protocol buffers serializer can give huge performance benefits due to two reasons- it is faster and smaller than JSON; you will get faster and smaller responses.

  • Compression implementation

Implementing GZIP or Deflate compression as it is an effective and simple way to lower the package size and raise the speed. You should consider this feature while developing Asp.net Web API.

  • Using ADO.Net is another great thing

Written ADO.Net code is a fastest way to fetch data from database. In case you wish to have high performing Web API, you should avoid ORM and use ADO.Net.

How programmers can improve the Asp.net web API performance - Image 3
Hand coded ADO.net is faster and result-driven unlike ORMs.
  • Caching usage
You should use output caching on your Web API methods whenever a situation demands. Suppose, several users accessing similar response that will alter once a time in entire day.
  • Round-trips reduction with multiple resultsets
You can lower the round-trip numbers to database and Web API both with multiple resultsets functionality whenever possibility arises. Developers can extract multiple resultsets using DataReader. The below example will explain in better way:
How programmers can improve the Asp.net web API performance - Image 4
You can try combining objects into single aggregate object to reduce multiple HTTP requests to your developed Web API-
How programmers can improve the Asp.net web API performance - Image 5
  • Asynchronous Web API services use

When developers and programmers use asynchronous Web API services, it helps in raising multiple HTTP requests. Implementing Async is simple task-

How programmers can improve the Asp.net web API performance - Image 6






Itâs not tough for a .net programmer to write web API; thanks to the technology. They donât need time investment for structuring high-performing applications. Here in this post, Aegis professionals will going to share some techniques to enhance asp.net Web API performance, so that the global community of asp .net development and the app users can make maximum use of apps.

  • Fastest JSON serializer use
The overall performance of Asp.net Web API can be affected by JSON serialization in significant manner. .Net programmers can measure approx 20% improvement on their Web API responses. Experts recommend this serializer to get high-performing solution.

How programmers can improve the Asp.net web API performance - Image 1

  • Creating JSON string from DataReader
Making things easy for app development, .net programmers can manually create JSON string using DataReader instead of reading values from it and developing JSON from Serializer. This will eliminate unwanted objects development and give least complications during programming. Developers can use StringBuilder to create JSON and return StringContent as the Web API response content.

How programmers can improve the Asp.net web API performance - Image 2

  • Using other formats like message pack, protocol buffer whenever possible
If you have other formats than JSON then go for it. Protocol buffers serializer can give huge performance benefits due to two reasons- it is faster and smaller than JSON; you will get faster and smaller responses.

  • Compression implementation


Implementing GZIP or Deflate compression as it is an effective and simple way to lower the package size and raise the speed. You should consider this feature while developing Asp.net Web API.

  • Using ADO.Net is another great thing


Written ADO.Net code is a fastest way to fetch data from database. In case you wish to have high performing Web API, you should avoid ORM and use ADO.Net.

How programmers can improve the Asp.net web API performance - Image 3

Hand coded ADO.net is faster and result-driven unlike ORMs.

  • Caching usage
You should use output caching on your Web API methods whenever a situation demands. Suppose, several users accessing similar response that will alter once a time in entire day.

  • Round-trips reduction with multiple resultsets
You can lower the round-trip numbers to database and Web API both with multiple resultsets functionality whenever possibility arises. Developers can extract multiple resultsets using DataReader. The below example will explain in better way:

How programmers can improve the Asp.net web API performance - Image 4

You can try combining objects into single aggregate object to reduce multiple HTTP requests to your developed Web API-

How programmers can improve the Asp.net web API performance - Image 5

  • Asynchronous Web API services use
When developers and programmers use asynchronous Web API services, it helps in raising multiple HTTP requests. Implementing Async is simple task-

How programmers can improve the Asp.net web API performance - Image 6

This blog is listed under Development & Implementations Community

View Comment (1)
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
  1. 09 December 14
    0

    Hi Ethan, do you know where could I find an example of a web api using stored procedure, I just find examples using EF, any help would be great.

    Thanks Alberto

You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top