ID:265603
 
Lets say I was displaying a HUD menu to a player.
Would it be better to.
(A) - Create the HUD invisibly, one piece at a time(instead of them all at once) then when they are all created, make them visible.

(B) - Create the HUD menu at once.
How long does it take to generate your HUD?

*Edit*

In particular, how long does it take to generate one object and how many objects are there?
In response to DeathAwaitsU
Well I created a dynamic menu creation system and I set the parameters of the proc so I can create it at any size I need..
So we are going to say a 5x5 sized menu.
And I don't really know how long, and that isn't the problem it's that I don't want it to spike the cpu usage..becuase if 1 person does that, and then there are 10+ players online..problem.
In response to Sniper Joe
Itd depends. Usually generating the whole menu at once doesn't make any problems. It might cause some lag when 10+ people doo it simutaneuosly. It also depends if you're gonna use it massivly within mob. Its a lot less laggy if you use datums to do Menu processing and such.
In response to Sniper Joe
I'd have to say keep the generic peices of the HUD predefined, or created and referenced objects at world/New(). This would save quite a bit of objects.


For instance:

HUD has 30 generic peices, borders, buttons, backgrounds, various designs. (Example)


30x10 players = 300 objects for 10 players alone, if new objects were created simply for them only.

But in the same example, if you were to just add the referencees to the set of already made objects, the count would just be those 30 generic peices.