The following graphs show the `perf` results from creating 1'000'000 item stacks in minetest using various constructor forms.
for _ = 1,1000000 do
ItemStack()
end
for _ = 1,1000000 do
ItemStack("mod:item 1")
end
for _ = 1,1000000 do
ItemStack({
name = "mod:item",
count = 1,
wear = 50,
})
end
itemstack = ItemStack({
name = "mod:item",
count = 1,
wear = 50,
})
for _ = 1,1000000 do
ItemStack(itemstack)
end