Performance and Complexity

Performance的三個要素是時間, 空間, 網路; Complexity是用來衡量Performance的指標

1. Performance

  • Consuming more of one resource can help consume less of another

  • Measure of performance

    • Time

      • The mount of processing or number of operations code has to perform to accomplish it's objective

    • Space

      • This is both memory needed by code to store information at runtime as well as disk space needed by code for persistent storage

    • Network

      • The bandwidth code uses to pass information to client or other machines

    • Efficient code uses fewer resource along all these axes

  • The amount of resource used determines code's performance

2. Complexity

  • Focus here is on space and time complexity

  • Complexity is a measure of how resource requirement change as the size of the problem gets larger

    • 當input size 變大時, complexity很重要

    • We also focus on the worst case performance

    • What is the maximum number of basic operations that might have to be performed on the input

  • The higher the complexity of a problem the lower the performance

Last updated