Question
In Python, which comparison about Profiling with cProfile and timeit is accurate?
- Profiling gives evidence, while intuition-only performance tuning often optimizes the wrong part of the program.
- There is no practical difference in behavior, performance, or maintainability when Profiling with cProfile and timeit is involved.
- The oldest option related to Profiling with cProfile and timeit is always the right production choice regardless of workload or context.
- Differences around Profiling with cProfile and timeit are mostly cosmetic, so correctness and debugging quality do not really change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: A. Profiling gives evidence, while intuition-only performance tuning often optimizes the wrong part of the program.
Profiling gives evidence, while intuition-only performance tuning often optimizes the wrong part of the program. This is the comparison that usually separates memorization from understanding.
Track: Python