smbinterp/plots/qhull_vs_delny/bench.py

26 lines
549 B
Python
Raw Normal View History

import sys
import time
import interp.bootstrap
import numpy as np
from interp.grid.delaunay import dgrid, get_qdelaunay_dump_str
from delaunay import Triangulation
# for count in xrange(100000,1000000, 100000):
count = int(sys.argv[1])
v = np.random.random((count, 3))
g = dgrid(v)
g_start = time.time()
g.construct_connectivity()
g_end = time.time()
dt_start = time.time()
dt = Triangulation(g.verts)
dt_end = time.time()
with open("output.cgd", 'a') as f:
s = "%d %f %f\n" % (count, g_end - g_start, dt_end - dt_start)
f.write(s)