Each test ranks a list of possible commands from best (most efficient) to worst (least efficient). Lower percentages are better. You can only compare the percentages between the commands in the same test.
These tests were done in a superflat world with no entities except for the player. The only commands running are the ones from the test.
A simple tick
advancement compared to as @a
Players | 1 | 8 | 32 |
---|---|---|---|
advancement | 0.28% | 0.38% | 1.32% |
function | 0.08% | 0.21% | 0.41% |
A tick
advancement with a condition compared to as @a[predicate=...]
Players | 1 | 8 | 32 |
---|---|---|---|
advancement | 0.13% | 0.30% | 1.19% |
function | 0.17% | 0.27% | 0.54% |
A tick
advancement with a nbt condition compared to as @a[nbt={...}]
Players | 1 | 8 | 32 |
---|---|---|---|
advancement | 0.27% | 0.59% | 2.20% |
function | 0.33% | 0.42% | 1.01% |
A location
advancement compared to schedule ... 1s
Players | 1 | 8 | 32 |
---|---|---|---|
advancement | 0.01% | 0.06% | 0.34% |
function | 0.03% | 0.03% | 0.05% |
The following tests compare combinations of execute subcommands. In general the rule is to have as few subcommands as possible.
execute as @e[nbt={OnGround:1b}] run ...
39.85%execute as @e if entity @s[nbt={OnGround:1b}] run ...
50.14%
execute as @e if entity @s[scores={foo=1..}]
37.02%execute as @e if score @s foo matches 1..
39.63%
execute as @e[predicate=foo] run ...
15.49%execute as @e if predicate foo run ...
20.45%execute as @e if entity @s[predicate=foo] run ...
23.32%execute as @e at @s if predicate foo run ...
25.22%