1 2 3 Previous Next 65 Replies Latest reply: Jun 24, 2009 1:20 PM by jschellSomeoneStoleMyAlias RSS

    Please review my loop and rewrite it for better performance

    843789
      I'm very new to JAVA and programming in general and know nothing about speed optimizing. I've written this loop, but is there a better way to archive (even theoratically) better performance? If there is please explain why another way is faster. My loop goes her:

      for (int x = 0; x < this.getWidth(); x++) {
           for (int y = 0; y < this.getHeight(); y++) {
      //Something goes here
           }
      }

      First post here, excuse me if I've posted it in the wrong category.

      Thanks in advance.
        1 2 3 Previous Next