diff --git a/src/database/database.jmc b/src/database/database.jmc index 2616c66..87ebecb 100644 --- a/src/database/database.jmc +++ b/src/database/database.jmc @@ -99,4 +99,37 @@ class database.benchmark { ::temp.index.del(); ::temp.result.del(); } + + function arrayTest3.setup() { + ::database.test.arrayTest3.array = []; + ::database.test.arrayTest3.index = {}; + Hardcode.repeat( + indexString="[index]", + start=0, + stop=500, + function=() => { + ::database.test.arrayTest3.array << {id: Hardcode.calc([index]+1), string: "entryHardcode.calc([index]+1)"}; + ::database.test.arrayTest3.index += {entryHardcode.calc([index]+1): [index]}; + } + ); + } + function arrayTest3.printArray() { + tellraw @a {"nbt":"database.test.arrayTest3.array","storage":"ferdinland:ferdinland"}; + } + function arrayTest3.printIndex() { + tellraw @a {"nbt":"database.test.arrayTest3.index","storage":"ferdinland:ferdinland"}; + } + function arrayTest3.clean() { + ::database.test.arrayTest3.array.del(); + ::database.test.arrayTest3.index.del(); + } + function arrayTest3._searchArray() { + $::temp.result = ::database.test.arrayTest3.array[string:$(keyword)]; + } + function arrayTest3.run() { + ::temp.keyword = "entry500"; + this.arrayTest3._searchArray() with ::temp; + ::temp.keyword.del(); + ::temp.result.del(); + } }