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

Add code profiling to identify matrix operation bottlenecks #16

Open
mattjshannon opened this issue Oct 18, 2018 · 4 comments
Open

Add code profiling to identify matrix operation bottlenecks #16

mattjshannon opened this issue Oct 18, 2018 · 4 comments
Labels
nice to have Nice to have

Comments

@mattjshannon
Copy link
Contributor

Would be useful to see if we can save some time during the matrix operations. Apparently the cProfile package is recommended, though I will look into this.

@PAHdb
Copy link
Owner

PAHdb commented Oct 19, 2018

With running example_fits.py, the performance hit is really due to writing out the PDF with matplotlib. Possibly there are some improvements that can be done there_?_ The example_fits.py takes 1:36 on my system with writing the PDF, 4 seconds when not writing the PDF-file ...

@PAHdb
Copy link
Owner

PAHdb commented Nov 14, 2018

There appear to be several options to speed-up the PDF production. While there are several alternative plotting packages, they all come with other requirements, e.g., Qt. On the other hand, several people suggest to reuse axis, etc. to speed up Matplotlib.

[update] Might be good to put an example output image(s)/plot(s) in the README and usage ...

@mattjshannon
Copy link
Contributor Author

It looks like snakeviz works quite well for profiling/visualizing the results (https://jiffyclub.github.io/snakeviz/).

It's installable via pip or conda, and you basically just use it thusly...

python -m cProfile -o profiling_results.prof example_fits.py
snakeviz profiling_results.prof (opens in your browser)

@PAHdb
Copy link
Owner

PAHdb commented Dec 12, 2018

Interesting. I've installed the package and ran the profiling. Unfortunately I'm not getting the nice graphs---it looks like it doesn't like space in path names ... Though, the bottleneck we have is still Matplotlib. You were mentioning before that reusing the axis for each plot could speed-up the PDF-output. My current thoughts are that moving away from Matplotlib might not be such a good idea given its widespread use among the community ...

@PAHdb PAHdb added the nice to have Nice to have label Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nice to have Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants