Click here to Skip to main content
15,885,767 members
Articles / All Topics

Five Common Mistakes When Dealing With Performance Issues in Your Application

Rate me:
Please Sign up or sign in to vote.
4.00/5 (7 votes)
22 Oct 2014CPOL3 min read 13.3K   3   6
Listed here are five common mistakes when dealing with performance issues in your application

As a software developer, we will have to deal with performance issues at some or the other point in our software development. I am listing out some of the most common assumptions and mistakes made by developers when dealing with performance issues.

Diagnosing Memory Leakage Issue as Performance Issue

An application's performance can severely degrade if memory consumed by it is not handled properly. If your components are not getting rid of unused memory, your application performance can severely downgrade over time. Even if you’re using run time environment like .NET or JAVA which supports automatic garbage collection, many recommendations are made to make sure that memory is cleaned up properly for your objects and allocations requests to be made in a specific manner to run your application in an optimal way.

Hot Spots Are Not Always the Problem

Many developers when encountered with performance use a profiler tool to identify hot spots in code and try to optimize only those. This is good but you will reach a limit and then on, you will not be able optimize any more. Most of the time, developers will be aware of hot spots in their code and profiler tool may show an unexpected hot spot like an event of a control firing more than (s)he taught which you may find ways to fix. Unless it's the latter case, most of the times, hot spots may not help you beyond a certain point, so you may have to take a step back and look at data structures, collections and algorithms chosen for your applications to see if they are the right choices and do appropriate corrections.

Adding More Threads May Degrade Performance

As soon as a performance issue appears, if memory leakage and hot spots are fixed or ruled out, the default tendency is to find places in your application where things can work in parallel and create threads or use threadpools. This will work most of the time, but going overdrive on number of threads being created or task queued in thread pool then it might start degrading. A healthy size of thread pool or number of threads must be chosen carefully based on target environment where your application is supposed to run. If multiple processors or mulit-core processors are not there, applications which are I/O bound will only benefit from adding threads.

Not Choosing Data Structures or Collections Carefully

The way you choose your data structures to store user and application data can make a huge difference in your application performance, so choosing the right one is very important. Certain algorithms for manipulating your data can be optimized by adding look up fields or additional fields in your data structure. Do consider them if it’s an option as you can reduce a lot of CPU time if cross referencing and looking up data in your data structure is complex. All languages libraries and frameworks provide built-in collections to store data. Be aware of how they are working internally and what's optimal for what situation. Choosing the wrong collection can degrade your application performance severely.

Not Being Careful While Using Third Party Controls or Libraries

Using Third Party libraries can save you a great deal of development time but read the documentation carefully. Many a times, developer look at example programs and build the application and as sample production data is used to test performance, issues tend to surface and might surface late in the development cycle. At times, I noted that upgrading to a newer version of Third Party library can have unexpected results as new performance bugs will get introduced, I had encountered this when an Excel export feature for grid which I was using crashed when upgraded to a newer version as it was not using Fly Weight pattern to keep color objects of a grid causing my application to slow down and crash for large grid sizes as it ran out of memory.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Gautham Prabhu K is a Software Engineer with 10+ years of experience in designing and developing software solution. He has experience working in Payment Gateway, Process Automation and Investment Banking industries.

Gautham has passion for engineering software solutions. He likes to design and build them efficiently, he has primarily worked on Microsoft .NET technology.

Gautham has dream of building his own software company someday. During his free time he likes to watch movies, go on long drives and write technical blogs/article.

Comments and Discussions

 
QuestionThank you Pin
AnotherKen23-Oct-14 12:16
professionalAnotherKen23-Oct-14 12:16 
AnswerRe: Thank you Pin
Gautham Prabhu K23-Oct-14 16:19
professionalGautham Prabhu K23-Oct-14 16:19 
Thank you, yes I agree that examples would have made this article look great.
GeneralMy vote of 1 Pin
Member 1090330723-Oct-14 10:38
Member 1090330723-Oct-14 10:38 
GeneralRe: My vote of 1 Pin
Gautham Prabhu K23-Oct-14 17:29
professionalGautham Prabhu K23-Oct-14 17:29 
QuestionOthers Pin
Iain Wood23-Oct-14 7:21
Iain Wood23-Oct-14 7:21 
AnswerRe: Others Pin
Gautham Prabhu K23-Oct-14 16:29
professionalGautham Prabhu K23-Oct-14 16:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.