Results 1 to 4 of 4
Like Tree3Likes
  • 2 Post By HouseStepFan
  • 1 Post By TheRigger

Thread: Arrayyyyys

  1. #1
    Senior Member
    TheRigger is offline

    Posts
    640

    Arrayyyyys

    Once you're 100% sure your Java program is bug-free and correct (i.e. it does what it's supposed to do), flatten your arrays!
    Take arr[n][m] -> arr[n*m] and
    Index arr[i][j] -> arr[i*m+j]

    Java stores its arrays as arrays of pointers to arrays, which is slower than using 1 contiguous block of memory.
    Do this and you may achieve a significant speedup (especially if your m-dimension happens to be a power of 2, like in nav)!

    #ByeByeNavLeaderboard

    Or, alternatively, you could start in C++ and just be fast af from the get-go.

  2. #2
    Dan
    Bot Coder
    Dan is offline

    Posts
    216
    stop bragging.

  3. #3
    Worlds Smallest ePeen
    HouseStepFan is offline

    Posts
    519
    or you could use lisp and be a dank memer
    erik and TheRigger like this.

  4. #4
    Senior Member
    TheRigger is offline

    Posts
    640
    damn i forgot about that
    there are thome thick memeth out there
    erik likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •