Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ue performance improvements #19

Merged
merged 3 commits into from
Nov 7, 2024
Merged

ue performance improvements #19

merged 3 commits into from
Nov 7, 2024

Conversation

camsinfiniteram
Copy link
Contributor

To improve the load time for user events. Previously, a separate call to cur_hax (the previous axis information) was required to restore properties of user events.

What we tried:
Separate function call: axes creation within for-loop was slow, so we moved it to another function and called it from make_tmarker
Parallel programming: create multiple 'workers' to perform tasks simultaneously (create all the user events at once)

Final changes:
Add the 'hax' parameter to the text function call.

Edge cases tested:
Multiple overlapping events
Deleting multiple events and reloading audioGUI
Moving user events and expanding
Changing pre-emphasis or LPC order

Running profiler, we observe the following for make_tmarker:

For a trial with 3 user events, an ~87% decrease in runtime is observed.

Test 1:
Before: 1.086 seconds
After: 0.144 seconds

Test 2:
Before: 1.085 seconds
After: 0.148 seconds

etc.

For a trial with 20 user events, a ~95% decrease in runtime is observed.
Before: 4.947 seconds
After: 0.210 seconds

etc.

@cwnaber cwnaber requested a review from carrien November 6, 2024 18:45
@cwnaber
Copy link
Contributor

cwnaber commented Nov 6, 2024

@carrien , I think this change is ready to go, but wanted to send it by your desk first, mostly as an FYI.

Another brief description of the issue/solution: wave_viewer uses the MATLAB built-in function text to create the label attached to user events, ie, the object which displays "uev1" next to a user event. Previously, text could only create a text object in the current axis, so wave_viewer would switch axis, make the text object, then switch back to the previous axis to create a label for each axis. Switching the current axis is very slow. Now, you can specify an axis when you call text, so no switching of the current axis is needed.

@carrien
Copy link
Member

carrien commented Nov 6, 2024 via email

@cwnaber cwnaber merged commit 01f2a97 into master Nov 7, 2024
@cwnaber cwnaber deleted the ue-creation branch November 7, 2024 00:29
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.

3 participants