#Which runs better?

1 messages · Page 1 of 1 (latest)

surreal kite
#

I'm deciding whether to do this processing code block as a string of execute commands in a function file, or as a scriptevent and I wanna know which one would run better. I wouldn't be able to use a switch statement if I use the scriptevent.

hasty wagon
#

functions run faster

spring fossil
#

It really depends what you're trying to do. If you're always going to do all of the commands then a function file might be faster. But well written JavaScript can be much faster in many cases

hasty wagon
#

no

#

mcfunction literally runs faster

#

before

surreal kite
#

so ig im asking if /execute if entity @e[tag=(tag)] is faster than entity.hasTag("tag")

lavish spindle
#

Tbh u porbably wont notice much of a difference

surreal kite
#

"Most things you could do in a function can be done in a script, but not everything because there are some differences. Functions can be faster because you don't need to go to get the disk and load a separate file (the function is already in memory when you call it), and because it runs in the existing process where a separate script will run in a subshell."

surreal kite
surreal kite
#

but scripts can do more stuff

#

for what im doing I only need tag scanning