Skip to content

Improved performance of resample thread - #50

Merged
dihm merged 1 commit into
labscript-suite:masterfrom
philipstarkey:feature/resample-performance
Nov 10, 2021
Merged

Improved performance of resample thread#50
dihm merged 1 commit into
labscript-suite:masterfrom
philipstarkey:feature/resample-performance

Conversation

@philipstarkey

Copy link
Copy Markdown
Member

While the resapmle algorithm released the GIL, we did not take advantage of the fact that this meant we could resample multiple channels in parallel.
A ThreadPool is now created to resample channels in parallel.
The code was also optimised to remove logging lines and reduce the number of calls in inmain, thus limiting the contention with pyqtgraph redraws and mouse move events.

While the resapmle algorithm released the GIL, we did not take advantage of the fact that this meant we could resample multiple channels in parallel.
A ThreadPool is now created to resample channels in parallel.
The code was also optimised to remove logging lines and reduce the number of calls in `inmain`, thus limiting the contention with pyqtgraph redraws and mouse move events.
@philipstarkey

Copy link
Copy Markdown
Member Author

pyqtgraph still seems to have poor performance when zoomed out on pseudoclock traces. I'm not sure why this is. Performance is significantly better when zoomed in enough that you start to be able to resolve individual clock ticks. Either way, resampling is happening much faster with this PR. It's particularly noticable if you zoom into a pseudoclock trace and then scroll left and right. Data loads much faster than previously!

@philipstarkey

Copy link
Copy Markdown
Member Author

Will merge on Monday if no comments

@philipstarkey philipstarkey self-assigned this Oct 31, 2020
@dihm

dihm commented Nov 8, 2021

Copy link
Copy Markdown
Contributor

@philipstarkey Can I safely assume this can be merged? If so, I'll go ahead and take care of it.

@philipstarkey

Copy link
Copy Markdown
Member Author

Presumably...it's been so long I've forgotten what I did 😛

@dihm

dihm commented Nov 10, 2021

Copy link
Copy Markdown
Contributor

Fair enough. I've confirmed that runviewer still works with this commit, so I'm going to merge.

@dihm
dihm merged commit 358908a into labscript-suite:master Nov 10, 2021
dihm added a commit that referenced this pull request Dec 7, 2021
commit 3007215
Author: David Meyer <dihm@users.noreply.github.com>
Date:   Tue Dec 7 10:57:54 2021 -0500

    Update setup.cfg and release builds to show python 3.9 support

commit 1e5a17b
Merge: 358908a ca3ab69
Author: David Meyer <dihm@users.noreply.github.com>
Date:   Tue Nov 30 11:51:18 2021 -0500

    Merge pull request #49 from philipstarkey/break-circular-dependency

    Updated runviewer to use the new labscript-utils device registry.

commit 358908a
Merge: 1d0ea1a 219e4e4
Author: David Meyer <dihm@users.noreply.github.com>
Date:   Wed Nov 10 17:15:14 2021 -0500

    Merge pull request #50 from philipstarkey/feature/resample-performance

    Improved performance of resample thread

commit 1d0ea1a
Merge: 72e5f26 d412be3
Author: David Meyer <dihm@users.noreply.github.com>
Date:   Fri Jul 16 16:13:02 2021 -0400

    Merge pull request #51 from dihm/runviewer-docs

    Initial pass at Runviewer docs

commit d412be3
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Thu Jul 15 10:34:50 2021 -0400

    Add docstring coverage check to build.

commit 1b0a4f5
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Thu Jul 15 10:34:38 2021 -0400

    Update sphinx pin.

commit 8734dfb
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Fri Jul 9 09:19:54 2021 -0400

    Attempting to global mock `labscript_utils` to prevent loading the splash,
    which cannot be done on RTD because there is no GUI to load it.

commit 04f23e6
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Fri Jul 9 09:17:55 2021 -0400

    Minor visual tweaks.

commit 511df28
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Fri Jul 9 09:17:27 2021 -0400

    Bumping sphinx version pins to match other modules.

commit 19c4b80
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 12:11:06 2020 -0500

    Mock missing site package methods, as was done in labscript-suite/lyse#79

commit 5b71c66
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 11:57:59 2020 -0500

    Adding the API reference page.

    Building this documentation requires soft-starting runviewer (which is
    automatic on import). Hopefully the readthedocs build doesn't mind that.

commit 1b94105
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 11:51:45 2020 -0500

    Fixing some of the references.

commit 04b1a5e
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 11:45:13 2020 -0500

    Add detailed documentation directly from @philipstarkey thesis.

commit 8b6bdbf
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 11:44:14 2020 -0500

    Add custom pyqt5 intersphinx inventory.

commit b358700
Author: David Meyer <dihm.meyer@gmail.com>
Date:   Tue Nov 17 10:13:37 2020 -0500

    Fix typo in icon name.

commit 219e4e4
Author: Phil Starkey <philipstarkey@users.noreply.github.com>
Date:   Wed Oct 14 12:57:02 2020 +1100

    Improved performance of resample thread

    While the resapmle algorithm released the GIL, we did not take advantage of the fact that this meant we could resample multiple channels in parallel.
    A ThreadPool is now created to resample channels in parallel.
    The code was also optimised to remove logging lines and reduce the number of calls in `inmain`, thus limiting the contention with pyqtgraph redraws and mouse move events.

commit ca3ab69
Author: philipstarkey <philipstarkey@users.noreply.github.com>
Date:   Thu Jul 16 17:22:52 2020 +1000

    Updated runviewer to use the new labscript-utils device registry.

    Removes the circular dependency on labscript-devices.

    This update assumes we will publish a new labscript-utils beta (3.1.0b1) shortly (so will fail to build on RTD until that is done)
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

Successfully merging this pull request may close these issues.

2 participants