Optimization Flashcards

1
Q

How can you alter a program to remove inefficiency?

A
  • change algos
  • restructure code
  • redesign data structures
  • refactor code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When should you optimize code?

A
  • Only when we have a real performance problem
  • If the code works, its good enough
    • 80-20 rule - 8-% of the program’s executing is spend in 20% of the code
    • focus on code that is called the most
How well did you know this?
1
Not at all
2
3
4
5
Perfectly