-
-
Save est31/f4ad8d4403f29ca230e3 to your computer and use it in GitHub Desktop.
minetest-getCraftRecipes-minimal-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Minimal Development Test | |
-- Mod: test | |
-- | |
local x = minetest.get_us_time() | |
local cnt = 20000 | |
--simulate a heavily modded game like dreambuilder | |
print('filling up the craft table...') | |
while cnt ~= 0 do | |
minetest.register_craft({ | |
output = "test:whatever"..cnt, | |
recipe = { | |
{"default:cobble", "default:cobble"}, | |
{"default:cobble", "default:cobble"}, | |
} | |
}) | |
cnt = cnt - 1 | |
end | |
local y = minetest.get_us_time() | |
print('time spent registering: '..(y-x)) | |
print('starting the loop... ') | |
cnt = 2325 -- change it to 10 if you want to spend your time profiling and not waiting for a result | |
while cnt ~= 0 do | |
minetest.get_all_craft_recipes("test:whatever"..cnt) | |
cnt = cnt - 1 | |
end | |
y = minetest.get_us_time() | |
print('time spent looking up: '..(y-x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment