jimbo1qaz
2018-11-22 05:50:52 UTC
I'm developing an audio oscilloscope-type program, which outputs frames as
raw bytes to ffmpeg and ffplay (which plays back video and audio together,
synchronized). I can also tell ffmpeg to output to file instead.
Originally I used matplotlib. I tried switching to pyqtgraph because I
thought it would be faster.
Unfortunately it ended up too slow for my use case.
- Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz, turbo 2.70GHz
- Windows 10 x64 (I can try Kubuntu 18.04 later)
- Miniconda Python 3.6.6
- pyqtgraph 0.11.0.dev0+g2e69b9c
I adapted pyqtgraph's speed test to resemble my data more closely (hide all
axises, no title, don't write fps to canvas):
-
https://gist.github.com/jimbo1qaz/472242d89a8fde421c39b4f86bf48b0e#file-pyqtgraph-speed-gui-py
- output to GUI
- 200-300fps
-
https://gist.github.com/jimbo1qaz/472242d89a8fde421c39b4f86bf48b0e#file-pyqtgraph-speed-image-py
- output to QImage
- starts at 766.36 fps, declines to 40-80fps (randomly toggles every
few seconds, may possibly depend on window focus)
In my own app rendering tests, I usually get 50-120fps, depending on data
and number of plots. In any case, this is far worse than matplotlib with
axis drawing disabled (118-158fps).
In either case, stopping in PyCharm (which sends Ctrl+C) results in
"Process finished with exit code -1" instead of a stacktrace, which
prevents me from taking a cProfile snapshot of my above speed demo.
I attached 2 cProfile logs. I closed the GUI after an approximate amount of
time, and terminated the QImage code using "for i in range(600)".
raw bytes to ffmpeg and ffplay (which plays back video and audio together,
synchronized). I can also tell ffmpeg to output to file instead.
Originally I used matplotlib. I tried switching to pyqtgraph because I
thought it would be faster.
Unfortunately it ended up too slow for my use case.
- Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz, turbo 2.70GHz
- Windows 10 x64 (I can try Kubuntu 18.04 later)
- Miniconda Python 3.6.6
- pyqtgraph 0.11.0.dev0+g2e69b9c
I adapted pyqtgraph's speed test to resemble my data more closely (hide all
axises, no title, don't write fps to canvas):
-
https://gist.github.com/jimbo1qaz/472242d89a8fde421c39b4f86bf48b0e#file-pyqtgraph-speed-gui-py
- output to GUI
- 200-300fps
-
https://gist.github.com/jimbo1qaz/472242d89a8fde421c39b4f86bf48b0e#file-pyqtgraph-speed-image-py
- output to QImage
- starts at 766.36 fps, declines to 40-80fps (randomly toggles every
few seconds, may possibly depend on window focus)
In my own app rendering tests, I usually get 50-120fps, depending on data
and number of plots. In any case, this is far worse than matplotlib with
axis drawing disabled (118-158fps).
In either case, stopping in PyCharm (which sends Ctrl+C) results in
"Process finished with exit code -1" instead of a stacktrace, which
prevents me from taking a cProfile snapshot of my above speed demo.
I attached 2 cProfile logs. I closed the GUI after an approximate amount of
time, and terminated the QImage code using "for i in range(600)".
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/055c582e-5018-4c37-a977-6b07062e103e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/055c582e-5018-4c37-a977-6b07062e103e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.