Skip to content

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
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?

3 participants