Thread: ArrayList or Array?

Results 1 to 8 of 8
  1. #1 ArrayList or Array? 
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    I am sick and tired of hardcoding everything into the server and have made a really basic ScriptEngine for my server. I am wanting to work on it and performance is key for it.

    What should I use for the script pool (holds scripts) ArrayList or Array? I heard Arrays are faster? Not sure if this is true or not...

    What is the + & - to using Arrays over ArrayLists and vice versa!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2009
    Posts
    608
    Thanks given
    1
    Thanks received
    17
    Rep Power
    6
    I can't explain that much but arrays are like events and arraylists are like processes.
    Events are smoother and faster, so use arrays.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Markian's Avatar
    Join Date
    Apr 2009
    Posts
    613
    Thanks given
    17
    Thanks received
    26
    Rep Power
    373
    "Arrays offer many advantages over a List, like better performance and type safety. Plus, many java classes are backed by an array (String, ArrayList, etc, etc). The array API isn't out of date, it just isn't normally the best option for data collections of variable length."
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2009
    Posts
    438
    Thanks given
    29
    Thanks received
    108
    Rep Power
    0
    I personally prefer arrays, I find them quicker and make your server run smoother.
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jun 2008
    Age
    27
    Posts
    2,312
    Thanks given
    485
    Thanks received
    231
    Rep Power
    0
    maybe some sort of map so that you can define a key and use that o.0
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    May 2008
    Posts
    140
    Thanks given
    39
    Thanks received
    13
    Rep Power
    176
    Use an ArrayList.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Feb 2008
    Posts
    384
    Thanks given
    30
    Thanks received
    26
    Rep Power
    0
    An ArrayList is better than Array to use when you have no knowledge in advance about elements number. ArrayList are slower than Arrays. So, if you need efficiency try to use Arrays if possible.
    that is what I found
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    May 2008
    Posts
    140
    Thanks given
    39
    Thanks received
    13
    Rep Power
    176
    Quote Originally Posted by billygotshot View Post
    that is what I found
    This has been stated already...
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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