Skip to content

[freqtbl-] only start new threads for large or complex bins#3050

Open
midichef wants to merge 1 commit intosaulpw:developfrom
midichef:freqtbl_minimize_threads
Open

[freqtbl-] only start new threads for large or complex bins#3050
midichef wants to merge 1 commit intosaulpw:developfrom
midichef:freqtbl_minimize_threads

Conversation

@midichef
Copy link
Copy Markdown
Contributor

This PR is a draft/prototype for consideration.

On a FreqTableSheet with lots of small bins, like you get from: seq 111222 |vd - then F, mass selection events like gs or , are 5x slower than they could be.

FreqTableSheet selection is slow, because every bin selection starts a new thread. For small bins, the thread startup time dominates the bin processing time. This PR skips starting a new thread for small bins with < 100 elements, since they'll be handled quickly enough to preserve interactivity. On my old system, Python 3.10, it gives a 5x speedup for gs on sheets that have only small bins.

What do you think? It's not elegant, and this implementation using select_is_quick is definitely ugly, but 5x is quite a lot.

Gives a 5x speedup on sheets that contain only small bins.

Introduces new sheet parameter select_is_quick that should be set
to True for sheets where selecting is a slow operation, so that
selection can be paused to update the display.
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.

1 participant