Browse Source

added some code to time loading from gmsh vs. from pickle

master
Stephen M. McQuay 8 years ago
parent
commit
1a4d635362
2 changed files with 25 additions and 0 deletions
  1. +13
    -0
      tools/timing/load_pickle.py
  2. +12
    -0
      tools/timing/read_gmsh_file.py

+ 13
- 0
tools/timing/load_pickle.py View File

@@ -0,0 +1,13 @@
import sys
import pickle
import time

import scipy.spatial


start = time.time()
g = pickle.load(open(sys.argv[1], 'r'))
g.tree = scipy.spatial.KDTree(g.points)
end = time.time()

print end - start

+ 12
- 0
tools/timing/read_gmsh_file.py View File

@@ -0,0 +1,12 @@
import sys
import time
import pickle

from interp.grid.gmsh import ggrid

start = time.time()
g = ggrid(sys.argv[1])
print time.time() - start

g.tree = None
pickle.dump(g, open(sys.argv[2], 'w'))

Loading…
Cancel
Save