On Thu, 1 Nov 2018 at 17:44, Jürgen Spitzmüller <sp...@lyx.org> wrote:
> Am Donnerstag, den 01.11.2018, 16:26 +0100 schrieb Kornel Benko: > > This would not be better. > > I was not saying it is good. I was just saying it's not a loop. > > 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. Another small issue, if the usage of range under Python2 which also contributes quite a bit to the performance hit. Jürg >