[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/master] Fixup d723b903: Fix slow display of large paragraphs
From:       Jean-Marc Lasgouttes <lasgouttes () lyx ! org>
Date:       2022-05-19 13:43:08
Message-ID: 20220519134308.3B6212805FF () lyx ! lyx ! org
[Download RAW message or body]

commit c6725df2dbbedac06386521f3c371fdd0257eec8
Author: Jean-Marc Lasgouttes <lasgouttes@lyx.org>
Date:   Thu May 19 16:03:57 2022 +0200

    Fixup d723b903: Fix slow display of large paragraphs
    
    When implementing multi-row string breaking, an extra createLine()
    statement, which made sense in the original code, was kept by mistake.
    This basically made the mechanism ineffective, because it created one
    row with the correct length, plus a second one with all the remaining
    text, which would have to be itself broken. This went undetected
    because the display is still correct.
    
    Additionally, this issue polluted the break cache to the extent that
    the hit rate could be 0%.
    
    Together, these two effects created a major slowdown with a document
    containing a single ~30000 characters paragraph.
    
    Fixes bug #12534.
---
 src/frontends/qt/GuiFontMetrics.cpp |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiFontMetrics.cpp b/src/frontends/qt/GuiFontMetrics.cpp
index cb9f5af..b3d37ca 100644
--- a/src/frontends/qt/GuiFontMetrics.cpp
+++ b/src/frontends/qt/GuiFontMetrics.cpp
@@ -567,7 +567,6 @@ GuiFontMetrics::breakString_helper(docstring const & s, int first_wid, int wid,
 		if (!line.isValid())
 			break;
 		line.setLineWidth(first ? first_wid : wid);
-		tl.createLine();
 		first = false;
 	}
 	tl.endLayout();
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic