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: 641
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.



 04/17/2021 01:07 AM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 641
Joined: 07/08/2019

BRIEF:


A few save profile / reopen cycles may be needed to make a newly imported profile load fast.


The advice of some on this forum to avoid saving your user profile once it is well trained is good. But I think one should save/reopen a few times after an import. And avoid working on a newly imported profile until it has been saved/reopened a few times, to allow Dragon's open-time optimizations to do their thing.


Dragon export/import does not round trip.


Why does nobody else see such problems? I suspect that I use export/import much more than most other people. Also more loops in my custom words.


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

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.

 04/22/2021 07:46 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 641
Joined: 07/08/2019

I am very happy. I seem to have found a fairly reliable way, a BKM, make a Dragon user profile load faster.

I have seen the Dragon profiles get taking five minutes or more to load, in several situations:

When the Dragon profile is slow to load after a profile exported earlier has been imported, which is what I typically what I do when Dragon hangs, crashes or gets unusually slow (sometimes and profile load, sometimes in ordinary dictation).

Sometimes just an ordinary restart of Dragon. Sometimes when the profile has been saved and is therefore reloaded when you restart. Usually I try to avoid saving my profile, as I believe in people on this form recommend. sometimes I accidentally save my profile. but I could swear that sometimes it is slow even when I have not saved my profile. which I do not understand, unless there is saving going on in the background.

--- Hmm, wait: could my problems have been Dragon backing up the user all? Is not done at profile load time? I would have expected it to be done at save time, but perhaps not. That's embarrassing. Since I use export/import as my backups, long ago I set Dragon option "don't back up user profile". but since I have several times created profiles and scratch, I forgot to reset that option in the new fresh profiles.
No, it doesn't seem to be backups. The stalls always seem to occur the point I have described in earlier posts, loading vocabulary.

Anyway, whether or not, a few iterations of save/close/open fairly reliably makes the profile load more quickly. it is not always the first iteration that speeds things up. Measurements below.


---+ some measurement data

Time to load a Dragon profile

actually, the "User and Topic load time", which seems to be largest
metric reported in Dragon.log when slow.

Times in seconds

The profile sped up when I went through one or more cycles of saving
the profile, and then reopening. Sometimes clsoing and restarting
Dragon between save and reload, but not always.

I should have annotated the following with occasions where I save the user profile or not. Obviously I have the data in Dragon.log, but I didn't do it in this script. and now that I think about it, I will probably grep out backups.

04-19|14:07:12.074 32.705 med
04-19|15:14:28.853 36.163 med
04-19|15:16:31.741 12.224
04-19|15:17:31.005 12.030
04-19|15:26:57.833 38.252 med
04-19|15:27:49.476 11.329
04-19|15:29:16.322 37.114 med
04-19|15:35:50.926 37.309 med
04-19|15:36:54.182 12.684
04-19|15:40:38.447 12.591
04-19|15:43:10.336 11.293
04-19|15:44:13.571 12.506
04-19|15:48:12.951 37.283 med
04-19|15:49:15.570 12.125
04-19|15:59:16.617 49.101 med
04-19|16:00:24.336 12.769
04-19|16:01:18.991 12.151
04-21|09:05:29.372 36.930 med
04-21|09:55:55.978 137.044 <-- slow: 2 minutes
04-21|09:57:57.517 14.684
04-21|10:18:28.736 12.885
04-21|18:28:27.269 307.290 <-- slow: 5 minutes
04-22|00:12:36.928 612365
04-22|15:10:09.893 270.875 <-- slow: 4.5 minutes
04-22|15:11:56.648 13.451
04-22|15:13:05.037 13.324
04-22|15:26:16.569 13.089

---

 

One might ask how  it is an improvement to explicitly go through a number of iterations saving a slow  profile, and reloading it.

 

A:  at least I know when this is happening. I can start a possibly slow iteration overnight, or just before I go to lunch.  and in general, it is much less frustrating when I expected, then when it happens  unexpectedly.

 

A2:  as mentioned above, I usually try NOT to save my user profile.  at least not when the profile feels like it's getting slow. I only rarely train things. Lunis and Leslie showed how  to use custom words so that Dragon usually guesses the pronunciation without me training.

Because I was trying to avoid staving and then reloading my profile, I frequently would run on exactly the same slow profile that I had imported. A profile that was slow from the get-go. Even if the profile before the export was fast, the profile after the export is often slow. Now I know to go through a few of these iterations every time I abandon a suspiciously slow user profile, and go back to a backup  profile and export format.

 



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

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.



 04/23/2021 03:27 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 641
Joined: 07/08/2019

Sweet!!

Since I posted last night I have had several instances

04-22|15:26:16.569 13.089 <-- fast
04-22|19:28:28.591 268.451 <--- slow
04-23|11:03:10.501 266.709 ""
04-23|11:30:16.930 268.157 <--- medium
04-23|11:47:18.448 40.594 ""
04-23|11:50:26.973 40.715
04-23|11:52:50.110 40.119


And the close/reopen cycle sped it up again. Although not unfortunately to the 13 second load times.

BTW I noticed that there was a 10 minute example in the previous post that my quick hand editing did not catch.

--

I wish I knew why these stalls occur, but it's nice to know that they can be fixed. Without abandoning the entire profile, which typically takes longer to recover from than it should.

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

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.

 04/29/2021 01:58 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 641
Joined: 07/08/2019

Some progress: it is not just export/import.

If I have the following Dragon speech command

Name: Test Control
Sub Main
Dim eng As New DgnEngineControl
eng.Register
eng.UnRegister(False)
Set eng = Nothing
End Sub

If I am running one of my normal recent profiles, with both Dragon and KnowBrainer (D started by KB)

If I execute the command above, and then, in the DragonBar, (a) close the active profile and then (b) reopen, then both the profile save/close and the profile open are very slow. I extracted profile open time from the log, and I have frequently seen it exceed seven minutes recently.

However, there is no problem if I am only running Dragon.

I only inferred that it was related to profile export/import, since my commands to easily export and import profiles use DgnEngineControl.

---

However, if I am running a completely new profile, I see no such problems either with or without KnowBrainer running. so, yes, it is something to do with my profile... but at the moment not running KnowBrainer seems to be the easiest way to deal with it.

Unfortunately, I like KnowBrainer... but I use it a lot less often recently.

---

I am not 100% certain that these problems do not occur if I am running Dragon without KnowBrainer. I am just reporting that I've been able to reproduce this problem with a much sure profile, but only when KnowBrainer is running. And not on a completely fresh or immature profile.



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

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.



 04/29/2021 05:51 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39241
Joined: 10/01/2006

Are you using KnowBrainer 2017 Build Ver. 4.0 or 4.51? This would explain the problem if you are still using Build 4.0. The solution would be to uninstall and reinstall. 1 of the Windows updates all but killed Build Ver. 4.0. You will find this information by right clicking on the hidden KnowBrainer icon (not the KnowBrainer shortcut) and selecting About



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

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

 04/29/2021 10:04 PM
User is offline View Users Profile Print this message

Author Icon
Ag
Top-Tier Member

Posts: 641
Joined: 07/08/2019

4.00.040 - thanks - I shall do as you say

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

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
32127 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 301 guests browsing this forum, which makes a total of 301 users using this forum.

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