-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add profiling and benckmarking (#513)
* Started profiling test suite. * Tests now need to be able to build package. * Filtered less for montepy * Made a big annoying model to stress MontePy for profiling and benchmarking. * Enabled big model CI work. * Fixed bad path. * Fixed benchmark and gave failure condition. * Increased failure threshold to 4 minutes. * Learned how to actually get the results from a profile. * GHA is slow: increased threshold. * Updated benchmark to not be near line lenght max.
- Loading branch information
Showing
7 changed files
with
16,104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ dist/* | |
.coverage | ||
.idea/* | ||
*.*.sw* | ||
*.prof | ||
doc/build/* | ||
.coverage | ||
.idea/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import montepy | ||
|
||
import time | ||
import tracemalloc | ||
|
||
FAIL_THRESHOLD = 500 | ||
|
||
tracemalloc.start() | ||
start = time.time() | ||
|
||
problem = montepy.read_input("benchmark/big_model.imcnp") | ||
|
||
stop = time.time() | ||
|
||
print(f"Took {stop - start} seconds") | ||
print(f"Memory usage report: {tracemalloc.get_traced_memory()}") | ||
|
||
if (stop - start) > FAIL_THRESHOLD: | ||
raise RuntimeError( | ||
f"Benchmark took too long to complete. It must be faster than: {FAIL_THRESHOLD} s." | ||
) |
Oops, something went wrong.