Execution Speed PowerPoint PPT Presentation

presentation player overlay
1 / 2
About This Presentation
Transcript and Presenter's Notes

Title: Execution Speed


1
Execution Speed
  • "final" and "static" methods are statically
    bound.
  • They execute slightly faster than instance
    methods.
  • final int findMaxSquare(int row, int col)
  • ... // this method is bound at compile time
  • // a class can be final, too
  • final class Island ...

2
Execution Speed
  • Access to 2-D arrays is most efficient if you
    vary the 2nd subscript fastest
  • int grid new int1020
  • // more efficient
  • for(row0 rowlt10 row)
  • for(col0 collt20 col) sum gridrowcol
  • // slower
  • for(col0 collt20 col) for(row0 rowlt10
    row) sum gridrowcol
Write a Comment
User Comments (0)
About PowerShow.com