#Need Opinion (Performant Based) on Question (In message):

1 messages · Page 1 of 1 (latest)

idle estuary
#

I have a scenario. Let's say I create an item (like assemble something using Instance.New, other cloning stuff, etc) as for a player request. Does it save more performance if I use it as a clone for the first player request and other player requests after its creation from the first player request or make it so for each creation to just use it on the player and delete it afterwards (Bassicly what im trying to say is, if the item does not exist it will create an item for that first player request and beyond OR create the item each time for different players, its not constant btw)?

young pewter
#

If its Virtually live[Lie-ve] in workspace it will use more performance because it is being visualized, cloning is like preparing while Instance.New is, I think also the same? Although it will use storage* if its not inside live virtual worlds.

idle estuary
young pewter
#

It'll be stored as data

idle estuary
young pewter
#

?

idle estuary
#

would it be better to create that lets say same item everytime or if the first time a player requests to use the item and that same item for the rest of the game if other players may request it

#

and i want it performant based not opinion based lol sorry

young pewter
#

._.

idle estuary
#

well im gonna just stick to creating it once after first request and then use that item to clone to other players. If anyone thinks the other way is better PLEASE DO NOT HESITATE TO TELL ME. Or please gladly explain.

young pewter
#

The other is better

idle estuary
#

explain please

wintry seal
#

if you’re asking if you should cache the clones then yes, that’ll likely be more performant than making new ones every-time

#

all you’d need to do is clone a couple and just set their CFrames to an extremely faraway distance and just update the values and CFrame upon player request, whenever the player is done with the clone reset the values to default and CFrame it away

#

one thing to note is that setting the .Parent property of instances is fairly expensive - avoid it when you can ideally

also it could be considered micro-optimization to cache the clones if these player requests are rather infrequent

foggy blaze
#

use partcache

#

:Clone is slower than Instance.new

idle estuary
#

as in the cached object

wintry seal
#

you’d have them in workspace, CFramed farrr away - that’s what PartCache as mentioned by Nom does

#

Re-parenting an instance isn’t good for performance

idle estuary
#

ah i see

#

so make it so if the player requests the object clone it once and if the player needs it again use the cframe method right

wintry seal
#

yep

#

pretty much

idle estuary
#

k

#

like how far exactly?

wintry seal
#

10e19 probably would be good

#

it has to be really far

idle estuary
#

so do i just paste that number for the cframe values?

idle estuary
wintry seal
#

yeah just make a new CFrame with those as the values

idle estuary
#

k thanks

idle estuary
chrome mantle
#

if you clone then it'll take some time to load

chrome mantle
#

I'm not sure about the performant but I think it really depend your game