Debugging is the process of removing software or hardware bugs (= errors).
Debugging is a difficult activity and, according to this study, occupies about 35% to 50% of a programmer's time.
A wise description of debugging was nailed by Brian Kernighan:
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." (Kernighan's Law)
Performance issues are considered OS bugs, so it is necessary to discover what causes bad performance and prevent that from happening.