On 11/1/18 12:26 PM, Jürgen Spitzmüller wrote:
> Am Donnerstag, den 01.11.2018, 18:09 +0200 schrieb Guy Rutenberg:
>> After some profiling the main culprit is the call to
>>
>> get_containing_layout, which is apparently some kind of O(n^2). For
>> example for de/Tutorial.lyx there are about ~5000 lines, and we
>> indeed call during the conversion we call get_containing_layout 5285
>> times. However, it calls find_end_of_layout a whopping 80936 times.
> I wonder whether you actually need this. Wouldn't it be more efficient
> to 
> 1. check whether the document uses Hebrew at all
> and
> 2. If so, search for parentheses and then check whether they follow a
> \\lang hebrew (and not any other \\lang) or whether they are in a
> document with main language hebrew and do not follow any other \\lang?

My second suggestion in the last email is along these lines, too. I
should have added that it is only when the language is Hebrew that we do
any of the other tests. (We have to go through the whole file, of
course, to find out whether Hebrew is ever used.)

Riki


Reply via email to