Hi, so I’ve been wondering which of these methods is faster:

I personally use method 1, so I want to know if I’ve been just been wasting my time declaring the vector3 outside the loop.
Hi, so I’ve been wondering which of these methods is faster:

I personally use method 1, so I want to know if I’ve been just been wasting my time declaring the vector3 outside the loop.
You can also do that :
while wait(1) do
vector3.new(1,1,1)
end
I think it’s faster than your method ! 
Have a nice day ! 
using the standard wait(1) throttles the engine (I’m pretty sure) while using task.wait(1) doesn’t. From what I’ve heard people say to use task.wait(1) instead of wait(1). Also I’m looking for more of a specific answer with speed tests (I don’t know how to do the speed tests) so I came here.
Sorry, I already don’t know how to do a speed test but a lot of programmer using wait() and not task.wait() because for the moment it does not change anything at all ! 
Storing the Vector3.new function in a variable will always be faster.
In method 2, you are always searching the Vector3 class for a method called “new”
In method 1, you find that method in advance and store in in a variable.
Hmm I see… Is the difference large, or so small there is no point in doing it?
We’re talking fractions of a millisecond. It really depends on what you’re using it for and how often you’re using Vector3.new().
Sorry for this code coming out of the blue but, for something like this that gets ran every 200-300 seconds:
local x = vector3(random(axisOffset,baseplate.Size.X / divisibleFactor),yAxisOffset,random(- baseplate.Size.X / divisibleFactor,baseplate.Size.X / divisibleFactor)) + baseplate.Position
local z = vector3(random(- baseplate.Size.Z / divisibleFactor,- axisOffset),yAxisOffset,random(- baseplate.Size.Z / divisibleFactor,baseplate.Size.Z / divisibleFactor)) + baseplate.Position
local xn = vector3(random(- baseplate.Size.X / divisibleFactor,baseplate.Size.X / divisibleFactor),yAxisOffset,random(axisOffset,baseplate.Size.X / divisibleFactor)) + baseplate.Position
local zn = vector3(random(- baseplate.Size.Z / divisibleFactor,baseplate.Size.Z / divisibleFactor),yAxisOffset,random(- baseplate.Size.Z / divisibleFactor,- axisOffset)) + baseplate.Position
(I also use method 1 for all other built in functions.)
So would this really be necessary in this case?
I mean, for something that only runs every 200-300 seconds, it’s not really worth the extra bytes of memory it takes up.
But considering how much you use it within that code block, I’d say it’s worth it.
My go-to rule of thumb is if you use something more than once, it’s usually worth storing it in a variable.
task.wait runs at 60Hz, while wait runs at 30Hz
Oh alright. Thank you very much.
while wait(1) do
vector3.one
end
This one is even faster!
It’s amazing, you- you’re a genius!