[liblouis-liblouisxml] Delay and CPU gobbling with translateString(), short files, and braillePages=yes

  • From: Joanmarie Diggs <joanmarie.diggs@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Sun, 30 Oct 2011 12:11:56 -0400

Hi all.

If I use translateString() from liblouisxml's python bindings to
translate the contents of a very short file, and I also have
braillePages set to 'yes', the amount of time it takes for that file
to be translated is quite large. And CPU shoots up to nearly 100% for
the duration of the translation. Setting braillePages to 'no' makes
the issue go away, and I've not seen this issue occur with files with
a more "normal" amount of text.

As for what is the definition of "very short file" and "long time", a
quick bit of data:

  character count of original: 93
  translation time: 0.003 seconds

  character count of original: 75
  translation time: 98.253 seconds

The second test case was a copy of the first test case with some words
removed. Both test cases were simple documents written in Gedit. And
both test cases were translated using the same configuration.

While not technically an endless loop (after all, the process
eventually does return), this issue sounds similar to "Fixed endless
loop when braillePages=yes" listed in the release notes for 2.4.0. So
at least in theory have that fix.

Any ideas as to what's going on?

Lastly, I am aware that all the cool kids are now using liblouisutdml.
And one day I hope to be a cool kid. <smiles> At the moment, however,
I have some existing software which depends upon liblouisxml and is
suffering from this bug. Thus any help you could provide would be most
appreciated.

Thanks in advance!
--joanie
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: