of     2   
chevron_rightchevron_rightchevron_right

dennis96411
#182511313Wednesday, January 27, 2016 7:34 PM GMT

Right now I'm just using "function() end", but I'm wondering if there's a faster built-in one that does the same thing.
128Gigabytes
#182511543Wednesday, January 27, 2016 7:39 PM GMT

Almost all of the ones that already exist local start = tick() for x = 1, 1000, 1 do (math.random)() end print(tick() - start) local start = tick() for x = 1, 1000, 1 do (function() end)() end print(tick() - start)
128Gigabytes
#182511637Wednesday, January 27, 2016 7:41 PM GMT

Or you can just predefine the function as a local variable for the fastest speed (Fasted I know how to get at least) Also if I'm misunderstanding the question I'm sorry local start = tick() for x = 1, 1000, 1 do (math.random)() end print(tick() - start) local f = function() end local start = tick() for x = 1, 1000, 1 do (f)() end print(tick() - start)
dennis96411
#182521605Wednesday, January 27, 2016 10:28 PM GMT

Any one that accepts any type of argument?
cntkillme
#182521851Wednesday, January 27, 2016 10:32 PM GMT

local x; there.
dennis96411
#182522076Wednesday, January 27, 2016 10:35 PM GMT

Alright, I found tick, time, versio, and UserSettings. Looks like tick or time are the fastest.
cntkillme
#182522371Wednesday, January 27, 2016 10:40 PM GMT

you don't need a function, i don't see why it matters
dennis96411
#182522648Wednesday, January 27, 2016 10:44 PM GMT

It needs to be callable with any argument without showing noticeable effects. I basically need an empty function, and I was just wondering if there were any faster C-sided ones that would achieve the same effect as calling "function() end".
cntkillme
#182522882Wednesday, January 27, 2016 10:47 PM GMT

Pretty sure something like local function nop() end will be faster than 'tick'
eLunate
#182522992Wednesday, January 27, 2016 10:49 PM GMT

Quick pull out the null machine pew pew pew
dennis96411
#182523219Wednesday, January 27, 2016 10:52 PM GMT

Actually, I just tested it. tick is faster.
cntkillme
#182523454Wednesday, January 27, 2016 10:56 PM GMT

Meh, probably
eLunate
#182523573Wednesday, January 27, 2016 10:58 PM GMT

Quick quick pull out the void machine weee wooo weee wooo
128Gigabytes
#182523928Wednesday, January 27, 2016 11:04 PM GMT

Cntkillme is right, local function nop() end would be faster local function test() end local t = tick local start = t() for x = 1, 1000, 1 do tick() end local withTick = (t() - start) start = t() for x = 1, 1000, 1 do test() end local withLocal = (t() - start) print(withTick > withLocal)
cntkillme
#182524550Wednesday, January 27, 2016 11:13 PM GMT

You're getting a global, it's not only a C call. local t = tick local start = t() for x = 1, 1000, 1 do t() end local withTick = (t() - start)
128Gigabytes
#182525580Wednesday, January 27, 2016 11:29 PM GMT

I called it globally on purpose (And didn't for time measuring)
128Gigabytes
#182525620Wednesday, January 27, 2016 11:29 PM GMT

Also even if I do it like that, tick() is slower
dennis96411
#182525636Wednesday, January 27, 2016 11:30 PM GMT

I called it locally in my test.
128Gigabytes
#182525668Wednesday, January 27, 2016 11:30 PM GMT

I tried calling it locally it made no difference.
dennis96411
#182525820Wednesday, January 27, 2016 11:33 PM GMT

I did 1000000 iterations.
128Gigabytes
#182525904Wednesday, January 27, 2016 11:34 PM GMT

I just did it with 1,000,000 too, still no difference, tick is still slower.
dennis96411
#182526381Wednesday, January 27, 2016 11:42 PM GMT

What if you passed it a few arguments?
128Gigabytes
#182526886Wednesday, January 27, 2016 11:50 PM GMT

I passed 7,999 arguments to each one No difference tick is slower
dennis96411
#182527604Thursday, January 28, 2016 12:01 AM GMT

Well, for whatever reason, tick is faster on my end.
128Gigabytes
#182527848Thursday, January 28, 2016 12:05 AM GMT

How are you testing it?

    of     2   
chevron_rightchevron_rightchevron_right