Solved Does this cause lag? (Multiple list of ItemStacks)

Discussion in 'Plugin Development' started by Orange Tabby, May 9, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Orange Tabby

    Hello plugin/java peoples. I'm making a SkyBlock plugin, and whenever a player creates a new island their UUID gets added to a map along with a new instance of my island class, within this island class it creates a list of ItemStacks that will be added to the chest. The items DO NOT change for different islands, so it creates the same list of ItemStacks in each instance, is this unnecessary and should I only have one list in my manager class and call it for each island instance.

    Basically I want to know if that unnecessary creation of multiple list will cause lag?
    The reason I'm asking this is because from my view its just ItemStacks... right?
    Also its not an array list, just a list
    Hopefully I explained that correctly. :D Free Cake [cake]
     
  2. Offline

    Lolmewn Retired Staff

    List is an interface; you can never "just have a list" :p
    Anyway, no, it doesn't. You can save some memory by storing the list only in one location, but CPU's these times are fast enough to create a list and add some items without you noticing.
     
  3. Offline

    Orange Tabby

    Okay thanks for the answer :D
     
Thread Status:
Not open for further replies.

Share This Page