PlotSpeedTest: add param tree control panel#1910
Conversation
|
on macOS with AntiAlias disabled and penWidth of 1
|
|
Something isn't being reset, when I first run I'm getting values in excess of 350ish fps, but when I start changing options, and then revert back, I'm getting 280ish fps Regarding options, would be great if we could add some more checks such as
|
|
Actually on the Pen one, hold off on that, hopefully we'll be merging #1844 soon which will have a PenSelectorDialog to the ParameterTree |
9b3f47f to
ff2d087
Compare
|
I have rebased to incorporate the merge of @dgoeries commit. Probably would need to change the setTitle update rate to be time-based rather than once every 50 updates. This is because the 50 value was based on the old fixed samples size of 5000 and we now allow the user to change the number of samples. |
ff2d087 to
292be1d
Compare
|
Added an option to choose between plotting random and sine tone. Plotting "regular" signals is significantly faster than a random signal (due to less pixels being rendered, I guess). In particular, pen width > 1 is usable. |
|
That's very interesting. I have stumbled on an explanation before that considered the number of self-overlapping pixels to be particularly problematic. Not sure if that is true or not, but the reasoning was that the overlapping part of the same line needed special treatment in case the line was rendered with partial opacity: |
a803a41 to
421641f
Compare
I added in an option to let the user try out plotting using Now, while |
...woah So while we've been thinking the limitation might have to do with the raster renderer, this might be a limitation of the raster render and the use of Which reminds me, I still need to submit a feature request drawLines take a pointer to a numpy array on the pyside channels... |
13dd2f3 to
8d42494
Compare
inspired by ScatterPlotSpeedTest.
22c6edf to
1a34c88
Compare
|
Nice use of #1844 for the Pen parameter tree :D When selecting some options, the plot doesn't render at all: Looks like toggling |
|
Were you using pen width > 1? The following says that macOS only supports opengl line width 1. You could try running the following to see the supported line widths for your machine. import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets
from OpenGL import GL
str_attribs = ['VENDOR', 'RENDERER', 'VERSION']
int_attribs = ['MAX_TEXTURE_SIZE', 'MAX_3D_TEXTURE_SIZE',
'ALIASED_LINE_WIDTH_RANGE', 'SMOOTH_LINE_WIDTH_RANGE'
]
float_attribs = [
'SMOOTH_LINE_WIDTH_GRANULARITY',
]
class GLTest(QtWidgets.QOpenGLWidget):
def initializeGL(self):
for attrib in str_attribs:
key = getattr(GL, 'GL_' + attrib)
val = GL.glGetString(key).decode()
print(f"{attrib}: {val}")
for attrib in int_attribs:
key = getattr(GL, 'GL_' + attrib)
val = GL.glGetInteger(key)
print(f"{attrib}: {val}")
for attrib in float_attribs:
key = getattr(GL, 'GL_' + attrib)
val = GL.glGetFloat(key)
print(f"{attrib}: {val}")
pg.mkQApp()
GLTest().show() |
|
I did indeed have a pen width of 2. Didn't realize that wasn't supported! .... on rerunning, now I can't replicate....wonder if I entered a bogus value and didn't notice. Thanks for the script; here's the output on my machine: For the fun of it, I set the pen width to 50, and it worked... ...why can't I replicate... |
|
Also some property does not appear to be resetting. I can start up the test, default settings, get ~450 fps. |
|
It seems that something sticks in Qt library the moment you have instantiated an QOpenGLWidget. I noticed something similar in VideoSpeedTest.py that conditionally instantiates a RawImageGLWidget depending on whether PyOpenGL is installed. I recall that I could get higher frame rates by uninstalling PyOpenGL. Also different behavior on Windows and Linux. |
That's sneaky! In the update function; I added a print statement In the Qt docs, there is quite the blurb about cleaning/tear-down, but I'm not sure how relevant that is here. |
|
As a comparison, I tried porting PlotSpeedTest.py to use QtCharts: Observations:
|
|
Nice work on the QtChart bit; ....wonder how it gets around that issue... It uses QGraphicsView and QGraphicsScene.. Looks like the deafult line thickness is 2 even! Oh, I see why ... they use |
|
So it's consistent with what can be demonstrated with PlotSpeedTest.py
|
Yeah, this just shows the need we have for using |
|
I don't think there's a need to ask for a Btw, it's The usage would be something like: arr = np.empty((count, 4), dtype=np.float64) # A QLineF is 4 floats
ptr = wrapInstance(arr.ctypes.data, QLineF)
painter.drawLines(ptr, count)similar to what is done for |
I should probably run this test myself; but was there a noticeable improvement in this use case? |
|
I am not confident nor keen to build such a big package as Qt. |
I misunderstood, I thought this needed a custom PySide build, not a custom Qt build. |
I am not sure, I just assumed that Qt (even if unmodified) would need to be built together. Assuming that PySide can be built alone, one would still need the Qt headers, Qt link libraries and dlls. And the C++ compiler would need to be the same. |
|
You can definitely build pyside independently of Qt. I did that a while
back for something; but there are instructions here
https://doc.qt.io/qtforpython/gettingstarted.html#guides-per-platform
…On Mon, Jul 26, 2021 at 16:52 pijyoi ***@***.***> wrote:
I misunderstood, I thought this needed a custom PySide build, not a custom
Qt build.
I am not sure, I just assumed that Qt (even if unmodified) would need to
be built together. Assuming that PySide can be built alone, one would still
need the Qt headers, Qt link libraries and dlls. And the C++ compiler would
need to be the same.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1910 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE5Z7XZZR4W42E7BB6Z7B3TZXYKTANCNFSM5AR77P4Q>
.
|
|
I find that if I remove the vsync-unlock code, then toggling useOpenGL False->True->False results in an fps of 60Hz. |
|
@pijyoi if there isn't a good way to "un-stuck" the openGL toggle, should we just add a little text blurb about it, and perhaps add a CLI argument to run with or without it (like VideoSpeedTest)? ...This is a great PR, I'd like not not hold it up due to a limitation of the framework. |
|
I added an option --allow-opengl-toggle. User thus has to explicitly opt-in to use this feature. Despite the stickiness, I did find it useful to be able to toggle between OpenGL <-> non-OpenGL. It was useful for discovering which combinations were absolutely un-usable. |
That's perfect, thanks for the PR @pijyoi ! |


inspired by ScatterPlotSpeedTest.
Allows easier testing of the speed benefits of useOpenGL and/or enableExperimental.
On a particular Linux system, useOpenGL=True and enableExperimental=False slowed to a crawl.