Answer by Sharmilli Priyadarsini:
If you are using SQL server or an equivalent database in the background to process your data, try the below steps:
1. Process most of the data in the database and transfer only the required result set to the application layer.
2. If you have used store procedures or functions, run a profiler in the the database administrator and understand which of your queries consume more time(Usually due to unwanted joins). Optimise the expensive queries.
3. Ensure you have removed unnecessary lines of code added during debugging to print values has been removed and you have followed the best practices.
Now, if you are using an ORM like Entity Framework, assuming you must have used LINQ to Entity to do the database querying, you can still do the database profiling to identify the expensive or time consuming code by running the database profiler and attaching it to the respective process.
If your front-end is taking consuming, run your Visual studio profiler from the Analyse menu, and see where are the code can be optimized. You can also use re-sharper to do code analysis.
Other key tips are,
1. Use server side pagination instead on the client side.
2. See if there are nested for loops or foreach loops used for data processing.
3. Push your data processing logic as much as possible to the database.
4. Make sure the memory management is taken care.
Hope it helps.