[liblouis-liblouisxml] Re: Python bindings and output buffer size for lou_translate*

  • From: Michael Whapples <mwhapples@xxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Wed, 04 Aug 2010 13:33:26 +0100

Hello,
OK, on the naming, may be what you suggest is better, it was late here when I created the patch. There is one thing I am not fully sure of on how you arrived at the value, the default for outlenMultiplier, its probably long enough I just don't know where it comes from.

Michael Whapples
On 04/08/10 03:56, James Teh wrote:
How about this?

Note that I prefer the name outlenMultiplier because it's not technically a ratio unless it's expressed as a quotient. Also, this makes the terminology easier to follow in that we talk about the length of the input, avoiding the need for the Python programmer to understand what's going on internally.

Jamie

On 4/08/2010 11:59 AM, Michael Whapples wrote:
Hello,
While memory isn't a huge concern I just like being as efficient as
possible. Also could memory be a concern for those using liblouis in
embedded devices (although there may be a question of why they would be
using python in such a case).

My personal view would be go for something like 12 times but allow the
ratio to be configured as desired as it adds very little in complexity
(eg. in the python case it is the difference of having the ratio as
module public variable or module level private, module level seems most
sensible to me as the ratio may be needed in more than one function). An
example of what I am meaning is attached (this patch only does the
translate function it would be easy enough to do the other functions).

I don't like the set it to a large value for the output buffer with no
relation to input buffer as what happens in the case someone chucks a
huge amount of input at liblouis? How do you decide what is really big
enough?

As for jlouis, currently sets the ratio to 2 times as that was what
everyone else seemed to do, but I am probably going to go with the large
default ratio but configurable if desired option.

Michael Whapples


For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: