Discord :
utchiha_market
Telegram :
https://t.me/utchiha_market
Auto Buy Store :
https://utchihamkt.mysellauth.com/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
Discord :
utchiha_market
Telegram :
https://t.me/utchiha_market
Auto Buy Store :
https://utchihamkt.mysellauth.com/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
Discord :
utchiha_market
Telegram :
https://t.me/utchiha_market
Auto Buy Store :
https://utchihamkt.mysellauth.com/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
Question
Solomun
Lets say i have an ArrayList list = new arraylist<l2pcInstance>. This list has about 1.000.000 l2pcinstance objects.
Do you think this would be a problem?
Lets say i want to create a method somewhere like:
getPlayersByLocation(String location)
{
ArrayList beta = new ArrayList<L2PcInstance>();
for (L2PcInstance pc : list)
{
if (pc.getLocation.equals(location)
beta.add(pc);
}
return beta;
}
Do you think this would cause a problem to servers memory? If this arraylist has about 1m items + i search in all of them frequntly?
I mean, it is better to search all time the database (SELECT from players where location = location)?
8 answers to this question
Recommended Posts