How programmers can improve the Asp.net web API performance
- 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.
- Creating JSON string from DataReader
- 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.
- Caching usage
- Round-trips reduction with multiple resultsets
- 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-
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