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

Make heatmap.py faster #17

Open
bogdanr opened this issue Apr 8, 2017 · 1 comment
Open

Make heatmap.py faster #17

bogdanr opened this issue Apr 8, 2017 · 1 comment

Comments

@bogdanr
Copy link

bogdanr commented Apr 8, 2017

I have a 6G csv file and the heatmap is processing for hours.
It would be nice if we could make use of multiple threads to make the heatmap script run faster.

@whyrlpool
Copy link

if you want to get a performance increase without changing any of the code, I've found it runs a smidgen faster (around 4x the speed) under pypy, yet there seems to be some inconsistency with the data output, which I'm yet to track down, but I think it's to do with the final line of pixels.

root@twelve:/home/pi/SoapySDR/build# time pypy ./heatmap.py /home/pi/output13.txt output13.png
loading
x: 20000, y: 214, z: (-130.909000, -61.927300)
drawing
labeling
saving

real    0m53.029s
user    0m52.658s
sys     0m0.330s
root@twelve:/home/pi/SoapySDR/build# md5sum output13.png
a7056db36a553099f4de77a7aabbf247  output13.png
root@twelve:/home/pi/SoapySDR/build# time python3 ./heatmap.py /home/pi/output13.txt output13.png
loading
x: 20000, y: 214, z: (-130.909000, -61.927300)
drawing
labeling
saving

real    4m4.220s
user    4m3.088s
sys     0m0.251s
root@twelve:/home/pi/SoapySDR/build# md5sum output13.png
5e1d17efccce25786dc54fddc476f8c7  output13.png

root@twelve:/home/pi/SoapySDR/build# du -h output13.png ../../output13.txt
2.1M    output13.png
42M     ../../output13.txt

If you want to spread the process across multiple cores you could use the slicing arguments (--low --high --begin --end) to specify what part of the graph you want to compute, and then slice the image back together with imagemagick, but I had issues with dimensions greater than UINT32_MAX so ymmv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants