Instantiating a prefab or creating new gameobject from script is more efficient?

I mean processing wise.

Say, I do something like:

            GemScript gemScript = new GameObject("Gem").AddComponent<GemScript>();
            SpriteRenderer spriteRenderer = gemScript.gameObject.AddComponent<SpriteRenderer>();

etc etc add a box collider to it.

vs

Instantiate ;
GemScript gemScript = gameObjectInstantiation.FindComponent();

Which would be faster?

I am having a tough time deciding to go full code to easily reference vs use prefabs and then FindComponent.

Scripting offers me some ease in implementing and flexibility, whereas prefab allows me ease to change stuff. At least, that’s what my limited knowledge tells me. My friend has been telling me that using script to generate objects is highly inefficient, which I argue is not bad really.

I’d like to know what you guys think about it?

Edit: I don’t know if I put it correctly, in essence it’s a question about how well UnityEngine handles instantiation, scenes etc vs manually spawning with script.

From my point of view, you should definitely use prefabs, unless you have a good reason not to do that. If you have performance issues, there are other strategies to improve it, like pooling and instantiating objects upfront that you need later on.
I suggest you to go with prefabs mainly, because you don’t seem to have a lot of experience yet. Usually it is not wise to perform optimizations, just because there might be a problem. It is very simple to try it out and to measure the performance and to find out what works better for you. And even if instantiating is slower, it could be fast enough.