Add benchmark for filling at ceiling level, to test skylight performance
This commit is contained in:
parent
4389c4640d
commit
b089d6f871
25
benchmarks/mceditlib/time_fill_ceiling.py
Normal file
25
benchmarks/mceditlib/time_fill_ceiling.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from benchmarks import bench_temp_level
|
||||||
|
from mceditlib.selection import BoundingBox
|
||||||
|
from mceditlib.util import exhaust
|
||||||
|
import logging
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
|
size = 50
|
||||||
|
|
||||||
|
def timeFillCeiling():
|
||||||
|
temp = bench_temp_level("AnvilWorld")
|
||||||
|
editor = temp
|
||||||
|
dim = editor.getDimension()
|
||||||
|
bounds = dim.bounds
|
||||||
|
x, y, z = bounds.center
|
||||||
|
y = 254
|
||||||
|
x -= size//2
|
||||||
|
z -= size//2
|
||||||
|
bounds = BoundingBox((x, y, z), (size, 1, size))
|
||||||
|
exhaust(dim.fillBlocksIter(bounds, editor.blocktypes["planks"]))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import timeit
|
||||||
|
time = timeit.timeit(timeFillCeiling, number=1)
|
||||||
|
print "Filled in %.02f (%0.3f per block" % (time, (time / (size * size)))
|
Reference in New Issue
Block a user