bane_
Howardianism High-Priest
- Joined
- Nov 27, 2013
- Messages
- 1,559
This is a very generic question about a specific characteristic (speed).
Which one is quicker/lighter for a system to run:
or
I imagine the first one would always be quicker if the conditions are mutually exclusive (elseif or return statements), but, as is, which one is better, when specifically speaking about speed?
Which one is quicker/lighter for a system to run:
Code:
function a(i, s, b)
if i == 1 then
--do something
end
if s == 'line' then
--do something
end
if b then
--do something
end
end
GameEvents.NiceDLLHook.Add(a)
or
Code:
function a(i, s, b)
if i == 1 then
--do something
end
end
function a2(i, s, b)
if s == 'line' then
--do something
end
end
function a3(i, s, b)
if b then
--do something
end
end
GameEvents.NiceDLLHook.Add(a1)
GameEvents.NiceDLLHook.Add(a2)
GameEvents.NiceDLLHook.Add(a3)
I imagine the first one would always be quicker if the conditions are mutually exclusive (elseif or return statements), but, as is, which one is better, when specifically speaking about speed?