KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Slow profile loads (~4 minutes) often related to Export/Import and Save/Open
Topic Summary: Workaround found (close/open a few times); still looking for cause
Created On: 04/17/2021 12:54 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 04/17/2021 12:54 AM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 647
Joined: 07/08/2019

I have been plagued by some very slow profile loads in Dragon.  E.g.  starting up Dragon (w/wo KnowBrainer)  often takes(took[*])  4 minutes  before I could say anything. E.g. closing a user profile, and  ithout leaving Dragon, opening a different profile,  might take similar time.

 

many experts on this forum  stated they have never encountered such problems and blame  either my computer HW/SW,  or me.  the latter quite likely to be true,  since I tend to stress whatever HW or SW I use.  as a once and future wannabe computer hacker I am very impatient doing things "by hand", using GUIs, when they can be automated.  I also inisist on an aggressive backup strategy, which may have bitten me here.

 

This morning a relatively fresh profile started taking 10 minutes to load.   therefore I perform some experiments. Here's what I  observed:

 

First,  starting off with a relatively quiescent profile,  which I exported a few days ago.   my notes indicate that before it was exported it was loading in approximately 40 seconds.  I will call this profile, as exported, X1.

 

 I imported X1,  closed the currently running profile ( I also tried importing with no running profile),  and then opened X1  without exiting Dragon.  => 300 sec.

 

[BTW,  I am going to simplify the discussion by talking in terms of three  basic load times: Fast:10 seconds, Medium:40 seconds, and Slow:300 seconds.  There is variation, e.g. from 9-16 seconds for the fast, 35-65 for the middle, and 240-400 for the slow.   but there are these three distinct clusters,  and it makes it easier to summarize results.]

 

[BTW^2, Although I measured these things by hand/stopwatch when I started months ago,  I now mostly extract the value "LOG (Perf): User and topic select = 10536 msec"  from Dragon.log,  which correlates quite well  with  stopwatch time.]

 

I.e.

 

Start with exported user profile on disk -  notes said that its predecessor, the profile that produced this export,  loaded Medium~40s. Import that profile. Open without leaving Dragon => slow~300s. Save  profile. Exit Dragon. Restart DragonUsing profile just saved => medium~40s.

 

 it gets messy to describe this in words, so let me create some notation. X1 =  Exported profile. P2 =  profile  her dragons "Manage/Open Profiles"  dialogs.  S3 =   dragons saved profile (as distinct from exported). A4 =  and actively running profile area.

 

 the distinction between Pn and Sn  may not be necessary, but it was in my notes. There is an important distinction between Pn and Ak

 

E.g. might have X42 --> P43 --> A44
 then exit without saving the profile
and re-import  X42-->P50->A51

 

 and so on

 

in this  notation I observed:

 

X1 -  exported user profile on disk -  notes said that its predecessor, the profile that produced this export,  loaded Medium~40s

 

X1 --imported--> P2. 

 

without exiting Dragon
    P2 ---opened--> active profile A3 => slow~300s.

P2/A3 --saved--> S4. 
Exit Dragon
Restart Dragon S4-->A5 => medium~40s
Repeatedly saving/opening/exiti9ng/restarting => medium~40s.

 

X1 --imported--> P6. P6 --opened without leaving Dragon--> A7 => slow~300s.
A7 -saved-->S8. 
 without leaving Dragonclose A7
open S8 --> A9 =>  medium~40s

 

Repeatedly saving/opening/exiti9ng/restarting => medium~40s.

this suggests that the first  profile load after an import will be slow~300s
but once you have saved profile once, subsequent loads  of that profile will be medium~40s
but   this case, in my notation below
X1--import-->P2
P2--open-->A3 <== slow~300s
A3--save-->S4 or P4
S4--open-->A5 <= medium~40s 
and 40s thereafter
is not always the case
 I observed  a few instances of
X11--import-->P12
P12--open-->A13 <== slow~300s
A13--save-->S14 or P14
S14--open-->A15 <= slow~300s 
A15--save-->S16
S16--open-->A17 <== medium~40s
 i.e. two save/open  cycles of slow~300s  
 were needed before we got into the medium~40s 
 almost steady state
and in fact,  for one profile,   one of the save/open cycles
resulted in fast~10s.
usually the fast~10s  load times occurred as follows:
active profile A
saved, closed, opened -> A'
without exiting Dragon
and without opening an intervening profile
 however, not all such "save/close/reopen"  sequences produced fast~10s,
 some were slow.
 nor is medium~40s  a permanent steady state. It lasts  until something else goes wrong.  I have observed profiles degrading to slow~300s and worse  in normal operation.  but this behavior  after importing  an exported profile  explains a law of the slowness I had observed. [explanation below]
BTW,  I have many exported profiles  with notes about their behavior. So  many of these experiments went back to historical profiles, where I knew how fast they were loading, but I don't necessarily know what I did between profile one and profile two  that produce the slowdown.   sometimes I can tell, by looking at my export history and Dragon.log, but sometimes I notes are good enough and I'm too lazy to correlate everything against my  git history for  custom words, etc.  let alone training, etc. which I seldom do.

---+ CONCLUSIONS

 

it looks like a good idea to save  your Dragon user profile at least once after importing it.   

 

the first  open of a newly imported profile  is often slow.

 

but not always: and I don't know exactly what is causing it to be slow.

 

 It is a bit of a pain to have to tolerate such slowness, but at least I can plan for it,  e.g. by importing such a profile backed up by export, and then save/opening it  all going ahead and doing something else. ( Since we are licensed to use Dragon on multiple machines, I am tempted to try to do that slow profile load after import on a different machine, but have not yet dared to do so.)

 

 

---+ What's all this about Export / Import?

 

There are at several ways of saving or backing up a Dragon profile:

 

The standard "Save Profile", later "Open Profile"  explicitly or implicitly when restarting Dragon and/or KnowBrainer.

 

Dragon's builtin backup/restore.  which actually saves the  profiles data files within the profile tree itself. I don't particularly like this because I don't have very much control over  how many such backups are are kept

 

Dragon's profile export/import.   I tend to use this a lot, because I can have as many profiles as my naming system can track.   E.g.  I start with a completely fresh profile,   import files of custom words, mostly text files, as well as deleting standard vocabulary.  And the occasional training, although I prefer to avoid that.    I periodically export,   so that at any point in time there is a sequence  of checkpoints between me and completely fresh. When I have a problem, I can backup as far back as I want.   I would backup all the way to completely fresh, except that applying some of my changes takes a while: e.g. I have no automation to delete vocabulary words. Therefore I try to  export such checkpoints most frequently when I have deleted some things.

 

Plus, you can always just copy the profile trees around.   This seems to produce profiles that load more quickly than those produced by export/import. However, it scares me a bit:  I have encountered COM errors  in doing this.  Also,  I think to be safe you should have completely exited Dragon before you copy these profile trees around.. Whereas the official Dragon export/import can be done  while Dragon is running.  ...  but:   profiles produced by this technique may simply load faster, and require none of the overhead of export/import to make the run faster.

 

 

---+  Conjecture

 

 the above are experimental results.   I don't know how reproducible they will be for other people, but I've been able to reproduce quite regularly.

 

Now, let me pass into the realm of conjecture:

 

 the above explains why some profiles are slow the first few times they are loaded after being imported.   It does not necessarily explain why a profile that was  fast/medium becomes slow when exported

 

 obviously, there is some optimization being done when you save a  newly imported profile.   and also, especially, when that newly imported-saved   profile is opened.     I expected this from the start. What surprised me is that occasionally it takes more than one slow~300s save/reopen iteration before things settle down to medium~40s. And sometimes they never settle down at all.

 

obviously the data structures are not fully optimized after an import.   The slow load time is probably due optimizing the data structures for future use.

 

 conjecture: doing a lot of work on a newly imported profile, with these not fully optimized data structures, may  do bad stuff.   E.g. if  the optimizations do node merging on the graph,  then importing a lot of vocabulary may produce  combinatoric explosion of the not yet merged nodes.    it might even make it impossible for node merging to work.

 

 that is total conjecture. Although it is based on my experience with similar  graph algorithms.

 

Anyway, my takeaway:  I will continue to use export to make checkpoints of my profiles. At least until I no longer need to do so, either because my profile never gets bad, or because I have automated tools to do things like delete words from the standard vocabulary,  so that I can start from a completely fresh profile without wasting 30 minutes to an hour or more.

 

 but I will endeavor to do  open the newly imported profile, and then save it  and reopen before I make any more 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.



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

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