Lordphenex's Avatar
Member
Level 40 Master Miner
17

Forum Posts

1 - 2 of 2

    2
    01/22/2023 6:53 am
    Level 40 : Master Miner
    Lordphenex
    Lordphenex's Avatar
    Yes if you don't have many players on your server, this is pretty useless. In fact, I used this method to track all the graves from my Graves datapack in order to be able to remove them when uninstalling datapack. If this is used on a small server that can have around 100 players, with potentially 2 or 3 unopened graves per player, the data set can get a bit big.

    I admit I did not conduct any test to see if it is really more efficient but I assumed that dividing your data set in smaller pieces would result in less copy operations (1 or 2 to get to the right array and up to a quarter of the original data set length for cycling through array). I don't know how much less effective it is to copy big set of data than a single element from an array.

    The nesting I proposed can be made differently like dividing the main array in 10 pieces instead of 2
    2
    01/15/2023 1:17 pm
    Level 40 : Master Miner
    Lordphenex
    Lordphenex's Avatar
    Yes that's true !
    I find third method more elegant as you don't need a recursion at all

1 - 2 of 2

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome