Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Which of these two is faster/better optimized?

Comments in 'Plugin Development' started by Tethered_, Jul 1, 2015.

  1. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    I'm trying to add player trails, which are just particles that follow around players as they walk. Which would be better speedwise for the server?

    1. Creating a new task for each player on the server when they join, which would add a particle every x ticks and cancel the task when they leave.

    2. Creating a task when the server starts which goes through a foreach loop on an array of players I made, which I can unset and set players to?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    2
  3. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    Why would that be?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Load due to inserting and removing players less than once per tick is obviously negligible.
    Handling many tasks in the ServerScheduler actually uses pretty much load as a lot of PocketMine-MP internals are related .
    LDX and Tethered_ like this.

Share This Page

Advertisement