The following graphs show the `perf` results from creating 1'000'000 item stacks in minetest using various constructor forms.

ItemStack()

for _ = 1,1000000 do
  ItemStack()
end
Graph showing ItemStack()

ItemStack(itemstring)

for _ = 1,1000000 do
  ItemStack("mod:item 1")
end
Graph showing ItemStack(itemstring)

ItemStack(table)

for _ = 1,1000000 do
  ItemStack({
    name = "mod:item",
    count = 1,
    wear = 50,
  })
end
Graph showing ItemStack(table)

ItemStack(itemstack)

itemstack = ItemStack({
  name = "mod:item",
  count = 1,
  wear = 50,
})

            
for _ = 1,1000000 do
  ItemStack(itemstack)
end
Graph showing ItemStack(itemstack)