Add iterations argparse argument to benchmarks#2418
Conversation
f50602e to
3095691
Compare
ed363de to
b8d64ee
Compare
bd24ccc to
71cf699
Compare
|
I should probably update VideoSpeedTest.py in a similar fashion. |
|
Hmm, I'll test on windows and see if I can replicate. |
|
@ntjess what Qt bindings were you using to create this issue? |
|
Also on Debating if this is "ok" or if I should add a little more logic to try and account for this. |
PyQt5 5.15.7 Qt 5.15.2 |
|
I am getting the same error on Windows 11, Qt5 and Qt6. The following 2 changes seems to make things work. flags = QtCore.QEventLoop.ProcessEventsFlag.AllEvents # equivalent to no flagscurve.sigPaintFinished.connect(eventLoop.exit, QtCore.Qt.ConnectionType.QueuedConnection)The problem as I see it is nested callbacks, the chain of which gets broken by using I do encounter such issues when using event loops. i.e. wanting to execute some piece of code after the current callback has completed. Qt doesn't have a convenient ready-made "CallAfter" function. |
|
If I understand things correctly, using Using the That said, there may not be a good way to capture the performance here short of much fancier signal/slot logic, in which case I should probably unwind the bulk of the diff that this PR has. |
|
I'm away from my windows machine for a few days but some potential solutions I thought of
The first option may impact the fps calculation in a way that is not accurate. |
71da7f0 to
4c9b926
Compare
|
@ntjess would you mind trying the ScatterPlot example again and see if you get the same issue? |
|
Still happens on 4c9b926 |
d306d06 to
f0af833
Compare
155adc7 to
b9e0aba
Compare
27e0191 to
8080478
Compare
|
Ok, after merging #2752 decided to revisit this and re-limit the scope. This PR only adds the This is useful when running a benchmark within a profiler, and developers need the application to exit before you can view the results. |
8080478 to
96bdfc6
Compare
Add functionality to allow for the benchmark to stop after a specific number of iterations. By default, will run indefinitely as it currently does, however if an iteration argument is passed with a numerical value, the update timer will stop, and the example will exit cleanly.
96bdfc6 to
c4e8c5f
Compare

Add
--iterationsargument to the benchmark examples allowing the benchmark to exit on its own cleanly afternupdates. This is useful for profilers which need the application to exit before computing results.EDIT: Below was the original PR post, decided to walk back the scope of this PR by scrapping the changes to try and compute the
setData+paintdurationAdd functionality to allow for the benchmark to stop after a specific number of iterations. By default, will run indefinitely as it currently does, however, if an iteration argument is passed with a numerical value, the update timer will stop, and the example will exit cleanly.
This is my first attempt at using QSignalMapper, while I would normally useself.sender(), the update method is a function, not a method, whereselfis not an argument being passed in.QEventLoop to block the python code until the paint function finishes. This should provide for a far more accurate duration calculation than
QApplication.processEvents()Redo the FPS calculation to take into account the entirety of the Qt EventLoop, not just the call to paint.