Instantiate a prefab vs create one dynamically at runtime?

I am wondering if there is a performance difference between loading a prefab into the game vs creating a gameobject programatically. I guess I can do either way, but was wondering if one is faster than the other, or if one takes less memory.

Let’s say I have 200 objects as prefabs and I only want to select 5 of them, vs. figuring out which 5 I want and then just creating them through code. Is there a huge memory difference between having those 195 prefabs not being used?

Like I said I can do it either way, and I don’t think there would be a performance hit but just wanted to see if the community knew any different.

The only thing I could think of is that if the prefabs are big in size that would be the only disadvantage, but I think they would be small so we can rule that out as a factor.

Any insight would be great!


when you are playing with the editor, it loads your public prefabs or scripts so there is no worry with that , but a good practice is to load them , even other resources and when needed you copy them . That way you wont have any surprise if the prefab was too huge. For the build , big prefabs should not be at runtime, my opinion , most of the time the prefab are always the same and are always instantiate at runtime .Just reminder that for a small game it is ok , but for a huge one , you might want to keep that memory for something else instead .