KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: FIXED: 5-6 second delays saying simple commands like "Press Delete" in Thunderbird and other commands
Topic Summary: DISABLED "Enable launching from the desktop"
Created On: 07/27/2021 02:09 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 07/27/2021 02:09 AM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

I wasted a good part of the last few days being plagued by a really bad slowdown  in many places.  The particular test case that I used was saying "Press Delete"  repeatedly in Thunderbird.  This should take less than a second,  but it was taking 5-6 seconds.

 

I have documented my experience in 

https://github.com/AndyGlew/manx-UI--Speech/wiki/Performance-Issues-with-Dragon-Speech-Recognition#56_second_stalls_saying_press_delete

 

Briefly: two components:

 

1.  "Enable launching from the desktop" was on

 

2.  the desktop contained files with "Nms_Dgn_cld_nt_pronce.txt"

 

It seems that Dragon  decided that such files  match almost any utterance, slowing everything down.   Or something similar.

 

Disabling "Enable launching from the desktop"  worked around the problem. 

 

As did making the filenames more pronounceable, although obviously the latter is  fragile,  and will break again the next time you have unfortunate files.

 

---

 

Posting just in the hope of saving somebody some time someday.  Possibly myself,  since I am fairly certain I have encountered this problem before, and had just forgotten about it, and had not automated mitigation.

 



-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.



 07/27/2021 10:53 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39333
Joined: 10/01/2006

If you need to press {Delete} several times in a row, substitute your KnowBrainer Delete <1to20> command. Example, if you need to press delete 5 times say Delete 5. The same rule applies to {Backspace}, {Space}, {Tab}, {Enter} and {Shift Tab}. We additionally recommend saying Data Options and removing the checkmark from Conservative space required by user profile for speed issues. This is detailed in the latest KnowBrainer Dragon manual.



-------------------------

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

 07/27/2021 07:10 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

I really need to make my point more obvious.

 

"Press Delete" was just an example of a simple command that was suffering a performance problem.   There were others. "Press delete" was just one of the easiest ones to test, over and over again.

 

I.e. the point is not that I was looking for a better way to do multiple press deletes. 

 

My AutoHotKey commands can similarly do repeat counts.  

 

 

 

 

 

 



-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.

 07/27/2021 11:59 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7693
Joined: 03/04/2007

AG,

That was excellent detective work on your part, especially with regards to the message in the Dragon logfile, revealing the delay, and pointing at "cfgfindword" failing to find a pronunciation according to the spelling of the file name on the desktop. However, as you have already stated, the question remains what it has got to do with desktop commands along with Thunderbird, but not along other apps. Doesn't really make sense, does it?

Personally, I have never disabled "Enable launching from desktop" or from the start menu, and have never encountered a a problem with it; but then, I don't use Thunderbird.



-------------------------



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 07/27/2021 07:15 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

I did see performance problems with other commands, such as dictating into a chrome text window. Repeatedly saying "press delete" into Thunderbird was just the test case I used to explore the problem.

 

at first I thought the problem was Thunderbird related, since I have some fairly aggressive AutoHotKey scripts active awhile Thunderbird is running, to fill all letters and prevent misrecognitions being interpreted as unmodified keystrokes. I spent a lot of time thinking it was my fault.  but stripping out all of my commands and all of my vocabulary left the same problem - worst with Thunderbird, but present in a few other apps.

 

And disabling the option Dragon-StartApp from the desktop, and/or sanitizing all filenames on the desktop, cured the problem.

 

Yes, still curious, but I have spent enough time on it. I hope that my notes will help other people avoid wasting such time.

 

One of my key learnings: look at Dragon.log ASAP, instead of thrashing around undoing recent changes.   

 



-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.



 07/28/2021 10:59 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39333
Joined: 10/01/2006

We have been working on the slowdown issue for the last 6 months and have one more recommendation to add to disabling desktop shortcuts. We additionally recommend adding a check mark to Conserve disk space required by user profile in the DragonBar Options/Data tab. You will find the other 26 sandtraps fixes in our KnowBrainer Dragon Installation/Training Guide



-------------------------

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1



 07/28/2021 05:37 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

Originally posted by: Lunis Orcutt We have been working on the slowdown issue for the last 6 months and have one more recommendation to add to disabling desktop shortcuts. We additionally recommend adding a check mark to Conserve disk space required by user profile in the DragonBar Options/Data tab. You will find the other 26 sandtraps fixes in our KnowBrainer Dragon Installation/Training Guide

#1: I have no reason to believe that it is a KnowBrainer problem, since I am not using KnowBrainer at the moment

#2: Good, all help in avoiding slowdowns appreciated

#3: I have already disabled Conserve disk space required by user profile
#4: I am publishing my own similar list of Dragon configuration BKMs at  https://github.com/AndyGlew/manx-UI--Speech/wiki/Performance-Issues-with-Dragon-Speech-Recognition#Disable_as_much_as_possible_ (Dead Link)
(looks like I'll need to make it into a freestanding wiki page)
I may compare it with your list, although since I cannot just click on the link and get your list I'm too lazy to look it up right now.


-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.



 07/30/2021 12:35 AM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

Originally posted by: R. Wilke ... the question remains what it has got to do with desktop commands along with Thunderbird, but not along other apps. Doesn't really make sense, does it?


Thinking about it, a hypothesis that does make sense:


Saying "Press Delete" in GNU EMACS, at least in the environment I was using, was an action that was solely performed by the Emacs process, literally deleting a single character in a buffer. No interprocess interaction, beyond that necessary for Dragon to get something from my lips to Emacs' input.


Whereas saying "Press Delete" in Thunderbird's message window, accessing Gmail via IMAP, if online, involves sending messages across the network.
Certainly a lot more work. If done immediately, certainly network activity. Quite possibly involving multiple threads and processes and devices.


I considered this possibility, and tried operating Thunderbird off-line. Supposedly this would mean no network activity, but I can easily imagine that there is still thread/process activity, e.g. to to the moral equivalent of an IMAP proxy or log queuing up actions to later be synchronized.



But even if this is true, you would stiill expect that if "Press Delete" required Dragon to go and look at the desktop and then timeout or Thunderbird, it might also need to do the same thing for Emacs. After all, the utterance would need to be checked against the desktop in both situations.


However... checking against the desktop can obviously be a slow operation. Like, six seconds slow, timing out... Any reasonably competent programmer would cache the result.
But whenever you have a cache, you have to worry about cache consistency. You probably want to invalidate the cache whenever there is a chance that somebody has modified a file but for which you have cached some information that might have changed.


Lots of people use lots of heuristics for such cache invalidation. Sometimes simply time. Sometimes counts of events such as keystrokes or network packets.


IIRC Windows has ways of registering handlers related to event like a file being added or changed in a directory. Sounds good, right? if Dragon had such a cache of metadata related to files on the desktop, it would only get invalidated when something really has happened.
Much better than polling, right?


Except that... the specification of such event handlers is usually they must be capable of handling spurious events. The interface may make it look like you are monitoring a single file, but the implementation may inform you whenever any file in the directory is modified. Or if some other system resource has been preempted or consumed, you send possibly spurious events. The event handler is expected to handle the case where the event has not happened. Oftentimes you don't really need to check, you might simply invalidate the whole bloody cache. Invalidating the cache is always semantically correct, it just costs performance.



You might be able to avoid some of that on cost by rechecking or re-verifying some of the cached metadata, without simply invalidating it and reloading it the slow way. E.g. you might remember that file Sm_Fnky_Nam.txt is on the desktop, timed out the last time you tried to do Dragon-StartApp, so you check if it is still there and what is modification time is.



I.e. performance hackers often put efficient polling code even in event handlers.
Because event handlers where you have to handle spurious events are essentially polling systems.

 

Less competent programmers are often not aware of this behavior in event handlers.  Sometimes it breaks the system, producing incorrect results, but often  it just affects performance, like unnecessarily invalidating a cache  maintaiined by software  and performing some instructions in the event handler. 


---


Anyway, that's a random guess. Other things related to network traffic and resource/multiprocess issues might similarly explain it.


It's not so bad that the first time you try to Dragon-StartApp Sm_Fnky_Nam.txt you get a six second delay. it's bad that you get it over and over and over again.  or at least I got it over and over and over again, as visible in my Dragon.log file


GNU EMACS does not get it over and over and over again. Thunderbird does. But it's obviously not Thunderbird's fault, because the code is being executed by Dragon. It is probably an interaction between Thunderbird/IMAP/network and Dragon.


---



This is all just a guess. I am just painfully familiar with such issues, because I have on several occasions been the guy defining the interface, essentially the guy who wrote the fine print that the user of this operation must be prepared for the instruction to finish or event handler to be invoked spontaneously or spuriously.

 

(More often I have been the guy warning that too many spurious events can be a big performance problem.)




No, at this point in my career I am not defining many software APIs, except possibly in nonwork projects. But this sort of thing happens over and over again in computer architecture.  In fact, I  realized that this might  explain the situation with Dragon because I was writing up something related to such a problem in computer hardware.

 

 


R.Wilke: Personally, I have never disabled "Enable launching from desktop" or from the start menu, and have never encountered a a problem with it; but then, I don't use Thunderbird.

 

I have actually run into this problem launching from the desktop before. But back then I just deleted  or renamed the file and went on.   I can do that here, but it is in general disappointing to have to do that. I was not  uttering anything remotely similar to "Sm_Fnky_Nam.txt".  Dragon should not have been trying to StartApp  those files.

 

 

 

 

Note:  if you don't put any files on your desktop, if you put your working files in Documents or OneDrive - if your desktop only contains things that you expect to be able to click on -  you probably wouldn't run into this problem.   But if you use your desktop the way a real-world desktop get used, piling stuff on it in various places,  i.e.  the way  the  Ivan Sutherland and the Xerox PARC  guys intended the desktop to be used, you might get strange  file names on it.    But strange filenames are not a problem...  you would have to deliberately or accidentally go and click on one of them to try to get it started.    the problem with each recognition here is that a random utterance seems to be trying to start a file that has absolutely no human visible similarity between filename and utterance.

 

---

 

Anyway,  I am not going to try to  verify if this hypothesis is correct or not. I hope I can just remember this so that the next time I have  stupid performance problem in Dragon I  don't waste so much time.

 

---

 

And to preempt annoying responses:  the files in question on the desktop were not actually "Sm_Fnky_Nam.txt".  their filenames were not  naturally humanly pronounceable, unless you are used to Hungarian notation, and they had punctuation like underscores in them. IIRC  the underscores were the thing that caused Dragon the most problem. When I rename the file not to have underscores in the file name, the problem went away. I suspect not related to caching, but to the utterance to file name matching.

 

But I'm not going to go back and look up the filenames.  especially since it is a chance I might not be allowed to post filenames because of NDA issues



-------------------------

DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design.



Statistics
32168 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 370 guests browsing this forum, which makes a total of 370 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.