What is faster / more effiecient?
[*] or [spigot]
I have a lot of instances where I add a number or not depending on a zero/one flag.
I can do this either by using the flag value to open & close a spigot or by mulitplying the number by the flag before adding it.
Need to save any spare nanoseconds!
-
What is faster?
-
I guess spigot is faster because when its state is off, it doesn't send any message through its outlet. But you should try to compute the CPU time with a lot of object.
-
Yes, you could test it using [realtime] and an [until] to run the process a bunch of times.
-
OK I did, turns out that [*] takes about 13% longer than [spigot] when the left input is an integer and the right input is just a 1 or a zero.