We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95a752f commit 35a462bCopy full SHA for 35a462b
2 files changed
benchmark/.gitignore
@@ -0,0 +1 @@
1
+*.prof
benchmark/benchmark.py
@@ -0,0 +1,31 @@
+import cProfile
2
+import pstats
3
+import time
4
+from datetime import datetime
5
+
6
+import pyDeltaRCM
7
8
+delta = pyDeltaRCM.DeltaModel(save_eta_figs=False)
9
10
+profiler = cProfile.Profile()
11
+for i in range(10):
12
+ if i==3:
13
+ start_time = time.time()
14
+ profiler.enable()
15
16
+ print(f"Iteration {i}")
17
+ delta.update()
18
19
+end_time = time.time()
20
21
+profiler.disable()
22
+profiler.print_stats()
23
24
+print(f"Total time = {end_time - start_time}")
25
26
+my_date = datetime.now()
27
+stats = pstats.Stats(profiler)
28
+stats.dump_stats(f"bench_result_{my_date.isoformat()}.prof")
29
+delta.finalize()
30
31
+# Results can be plotted with, eg, `flameprof -o /z/out.svg bench_result_2022-05-23T10:39:22.808217.prof`
0 commit comments