I can't explain that much but arrays are like events and arraylists are like processes.
Events are smoother and faster, so use arrays.
|
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!
I can't explain that much but arrays are like events and arraylists are like processes.
Events are smoother and faster, so use arrays.
"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."
I personally prefer arrays, I find them quicker and make your server run smoother.
maybe some sort of map so that you can define a key and use that o.0
Use an ArrayList.
that is what I foundAn 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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |