Making sure that all your statements are inlined by the Just-In-Time (JOT) compiler can vastly increase performance. Throw statements can slow things down so using a static helper can help keep things moving fast by containing them.

Less Virtual Calls

Minimize the amount of calls to virtual members as these use resources. If you can de-virtualize the calls your JIT compiler can then inline the calls. Follow these 2 basic steps to help get rid of unnecessary virtual calls:

  • Seal overridden methods and mark classes and methods as sealed (by default).
  • Use concrete types not interfaces

Pool HTTP Connections

Use Http Client Factory. This was introduced in ASP.Net Core 2.1 to help you pool HTTP connections thereby increasing performance and reliability.

Reduce Allocations

New types have been introduced which can be leveraged to increase performance for example, the introduction of SystemValueTuple. Taking advantage of these will avoid data copying and array allocations and improve the core performance.

Aggressive Caching

Make sure any stale data is cached immediately. There is middleware supported by ASP.Net Core to assist with this. Ncache is something that helps cache stale date which is fast acting and easy to set up.

Enable Compression

A smaller response improves the apps performance by reducing the amount of data transfer. ASP.Net Core supports response compressing as a middleware component allowing you to add this to the pipeline easily.

Reduce HTTP Requests

A good way of optimizing performance is to reduce the number of number of HTTP requests or by using HTTP/2. This combined with caching and reducing redirects can have a good impact on performance.

Avoid Blocking Calls

Avoid blocking calls using Task.Wait or Task.Result - just make asynchronous code paths and utilize PerfView or similar performance profile programs.

Lessen Large Object Allocations

Although .Net Core’s own program can release memory doing so uses CPU time, ArrayPool is the better option. This will cache frequently used objects rather than focus time and space freeing up large objects.

Use Exceptions Sparingly

Take care to avoid unnecessary exceptions. Using them only when needed will up performance.

Optimize Data Access

Data access APIs should be accessed asynchronously, avoiding multiple data collection trips and only pick up the necessary data. Data access is one of the key factors that slow an application.

Tuning a web application to enhance performance is complex but there are tools and techniques in place to help. MiniProfile, Application Insights, Stackify Retrace and MiniProfiler are application performance measuring tools to look out for. These can look at the issues and determine how to easily fix them, making the process easier for the developer.

If you're looking for a company that provides .NET Development and other Software Development Services — contact us.

Send Message

This field could not be empty.
This field could not be empty.
Incorrect email.
This field could not be empty.
This message could not be send. Please select correct CAPTCHA.
Your message has been successfully sent. We will respond as soon as possible.

Contact Us

+1 (949) 988-0447

2372 Morse Avenue,
Ste. 607,
Irvine, CA 92614
+375 (29) 744-23-52

Business Center "Park Plaza",
22a/2 Lahojski Trakt, Suite 304,
Minsk, 220090
Whatsapp Logo. Contact Aristek Systems Software Development Company in UAE via Whatsapp.
Tasmeer Residences,
Office 303,
© 2021, Aristek Systems Ltd., All Rights Reserved, Privacy Policy