2015-09-09 17:59:11 +02:00
|
|
|
--
|
|
|
|
-- Testing mod
|
|
|
|
-- By Kaadmy, for Pixture
|
|
|
|
--
|
|
|
|
|
2017-06-27 21:13:30 +02:00
|
|
|
if minetest.settings:get_bool("testing_enable") then
|
2015-09-09 17:59:11 +02:00
|
|
|
local t1 = os.clock()
|
|
|
|
for i = 1, 10000 do
|
|
|
|
dump({x=0,y=50,z=100})
|
|
|
|
end
|
2019-08-28 17:54:05 +02:00
|
|
|
minetest.log("action", string.format("10000 iterations with dump({x=0,y=50,z=100}) took %.2fms", (os.clock() - t1) * 1000))
|
2015-09-09 17:59:11 +02:00
|
|
|
|
|
|
|
local t2 = os.clock()
|
|
|
|
for i = 1, 10000 do
|
|
|
|
tostring({x=0,y=50,z=100})
|
|
|
|
end
|
2019-08-28 17:54:05 +02:00
|
|
|
minetest.log("action", string.format("10000 iterations with tostring({x=0,y=50,z=100}) took %.2fms", (os.clock() - t2) * 1000))
|
2015-09-09 17:59:11 +02:00
|
|
|
|
|
|
|
local t3 = os.clock()
|
|
|
|
for i = 1, 10000 do
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.serialize({x=0,y=50,z=100})
|
2015-09-09 17:59:11 +02:00
|
|
|
end
|
2019-08-28 17:54:05 +02:00
|
|
|
minetest.log("action", string.format("10000 iterations with minetest.serialize({x=0,y=50,z=100}) took %.2fms", (os.clock() - t3) * 1000))
|
2015-09-09 17:59:11 +02:00
|
|
|
|
|
|
|
local t4 = os.clock()
|
|
|
|
for i = 1, 10000 do
|
|
|
|
default.dumpvec({x=0,y=50,z=100})
|
|
|
|
end
|
2019-08-28 17:54:05 +02:00
|
|
|
minetest.log("action", string.format("10000 iterations with(custom function) default.dumpvec({x=0,y=50,z=100}) took %.2fms", (os.clock() - t4) * 1000))
|
2015-09-22 19:29:46 +02:00
|
|
|
|
|
|
|
local t5 = os.clock()
|
|
|
|
for i = 1, 10000 do
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.hash_node_position({x=0,y=50,z=100})
|
2015-09-22 19:29:46 +02:00
|
|
|
end
|
2019-08-28 17:54:05 +02:00
|
|
|
minetest.log("action", string.format("10000 iterations with minetest.hash_node_position({x=0,y=50,z=100}) took %.2fms", (os.clock() - t5) * 1000))
|
|
|
|
end
|