blab-lab / wave_viewer

Wave Viewer is a Matlab-based analysis tool for speech waveforms.
GNU General Public License v2.0
6 stars 2 forks source link

ue performance improvements #19

Closed camsinfiniteram closed 1 week ago

camsinfiniteram commented 1 week ago

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 commented 1 week ago

@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 commented 1 week ago

Looks good!

Carrie Niziolek Assistant Professor Communication Sciences and Disorders University of Wisconsin–Madison @.*** she/her


From: Chris Naber @.> Sent: Wednesday, November 6, 2024 12:50 PM To: blab-lab/wave_viewer @.> Cc: Carrie Niziolek @.>; Mention @.> Subject: Re: [blab-lab/wave_viewer] ue performance improvements (PR #19)

@carrienhttps://urldefense.com/v3/__https://github.com/carrien__;!!Mak6IKo!Kspl8Nbe1UJfU_y09E-0wpHDdhu40SQVOUZslIlg3qN7fwD1p0uyrFjfFSavRxBdWU-PsMfUdFkmU0f3o5IPyBwgoQ$ , 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.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/blab-lab/wave_viewer/pull/19*issuecomment-2460532164__;Iw!!Mak6IKo!Kspl8Nbe1UJfU_y09E-0wpHDdhu40SQVOUZslIlg3qN7fwD1p0uyrFjfFSavRxBdWU-PsMfUdFkmU0f3o5Jpa7Q60w$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAHIP3QNGFCNJCJZL2X4ZO3Z7JQIXAVCNFSM6AAAAABRJOZ4T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRQGUZTEMJWGQ__;!!Mak6IKo!Kspl8Nbe1UJfU_y09E-0wpHDdhu40SQVOUZslIlg3qN7fwD1p0uyrFjfFSavRxBdWU-PsMfUdFkmU0f3o5LMa-FK3Q$. You are receiving this because you were mentioned.Message ID: @.***>