Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding examples/dev_sandbox/prof.py #60

Merged
merged 6 commits into from
Dec 14, 2023

Conversation

xaviernogueira
Copy link
Contributor

@xaviernogueira xaviernogueira commented Dec 14, 2023

I am merging this before my other changes to allow any changes I make to be compared (in regards to performance) to our main branch.

I added examples/dev_sandbox/prof.py which runs TSM over N iterations in a loop, and prints out total time as well as time per iteration. N is 100 by default. You can use a command line argument to change the number of iterations (10 iterations ran below):

(clearwater_env) examples/dev_sandbox: python prof.py 10

This can be used with cProfile to make a profile_out.prof file, which can be visualized via snakeviz as follows:

# runs the code for 10 iterations and records the performance profiling
(clearwater_env) examples/dev_sandbox: python -m cProfile -o profile_out.prof prof.py 10

# opens a browser window to explore the performance
(clearwater_env) examples/dev_sandbox: profile_out.prof

Quickly going to merge in so I can test some things out. This does not close any issues.

@xaviernogueira xaviernogueira added the enhancement New feature or request label Dec 14, 2023
@xaviernogueira xaviernogueira linked an issue Dec 14, 2023 that may be closed by this pull request
3 tasks
@xaviernogueira xaviernogueira merged commit 8b53234 into main Dec 14, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve timestep performance further: numba or not?
2 participants