isuckatcode-pages/Minecraft Datapacking/When Two Macros are Faster than One.md
themodernhakr c4d8f54315
All checks were successful
Update pages on webserver / Update (push) Successful in 6s
vault backup: 2025-03-24 13:53:43
2025-03-24 13:53:43 -05:00

1.1 KiB

title published
When Two Macros are Faster than One true

While working on my Database datapack (still WIP), I knew I'd want to find

One Macro

data modify storage ferdinland:ferdinland temp.keyword set value 'entry500'

function ferdinland:database/benchmark/arraytest3/_searcharray with storage ferdinland:ferdinland temp

data remove storage ferdinland:ferdinland temp.keyword

data remove storage ferdinland:ferdinland temp.result
$data modify storage ferdinland:ferdinland temp.result set from storage`` ferdinland:ferdinland database.test.arrayTest3.array[string:$(keyword)]

Two Macro

data modify storage ferdinland:ferdinland temp.keyword set value 'entry500'

function ferdinland:database/benchmark/arraytest2/_searchindex with storage ferdinland:ferdinland temp

function ferdinland:database/benchmark/arraytest2/_searcharray with storage ferdinland:ferdinland temp

data remove storage ferdinland:ferdinland temp.keyword

data remove storage ferdinland:ferdinland temp.index

data remove storage ferdinland:ferdinland temp.result