Browse Source

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

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 @@
1
+import sys
2
+import pickle
3
+import time
4
+
5
+import scipy.spatial
6
+
7
+
8
+start = time.time()
9
+g = pickle.load(open(sys.argv[1], 'r'))
10
+g.tree = scipy.spatial.KDTree(g.points)
11
+end = time.time()
12
+
13
+print end - start

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

@@ -0,0 +1,12 @@
1
+import sys
2
+import time
3
+import pickle
4
+
5
+from interp.grid.gmsh import ggrid
6
+
7
+start = time.time()
8
+g = ggrid(sys.argv[1])
9
+print time.time() - start
10
+
11
+g.tree = None
12
+pickle.dump(g, open(sys.argv[2], 'w'))

Loading…
Cancel
Save