Add index lookup in benchmark test
All checks were successful
Deploy datapack to dev / Build (push) Successful in 7s
All checks were successful
Deploy datapack to dev / Build (push) Successful in 7s
This commit is contained in:
parent
087f852b54
commit
80fe00caba
@ -62,14 +62,14 @@ class database.benchmark {
|
|||||||
|
|
||||||
function arrayTest2.setup() {
|
function arrayTest2.setup() {
|
||||||
::database.test.arrayTest2.array = [];
|
::database.test.arrayTest2.array = [];
|
||||||
::database.test.arrayTest2.index = [];
|
::database.test.arrayTest2.index = {};
|
||||||
Hardcode.repeat(
|
Hardcode.repeat(
|
||||||
indexString="[index]",
|
indexString="[index]",
|
||||||
start=0,
|
start=0,
|
||||||
stop=500,
|
stop=500,
|
||||||
function=() => {
|
function=() => {
|
||||||
::database.test.arrayTest2.array << {id: Hardcode.calc([index]+1), string: "entryHardcode.calc([index]+1)"};
|
::database.test.arrayTest2.array << {id: Hardcode.calc([index]+1), string: "entryHardcode.calc([index]+1)"};
|
||||||
::database.test.arrayTest2.index << {entryHardcode.calc([index]+1): [index]};
|
::database.test.arrayTest2.index += {entryHardcode.calc([index]+1): [index]};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -84,8 +84,12 @@ class database.benchmark {
|
|||||||
::database.test.arrayTest2.index.del();
|
::database.test.arrayTest2.index.del();
|
||||||
}
|
}
|
||||||
function arrayTest2.run() {
|
function arrayTest2.run() {
|
||||||
::temp.keyword = {keyword: "entry500"};
|
::temp.keyword = "entry500";
|
||||||
execute run { $say "found: $(keyword)"; } with ::temp.keyword;
|
execute run {
|
||||||
|
::temp.index = ::database.test.arrayTest2.index.$(keyword);
|
||||||
|
tellraw @a {"nbt":"temp.index","storage":"ferdinland:ferdinland"};
|
||||||
|
} with ::temp.keyword;
|
||||||
::temp.keyword.del();
|
::temp.keyword.del();
|
||||||
|
::temp.index.del();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user