There have been problems with Scintilla drawing long runs of text with some platforms crashing, or failing to display or drawing incorrectly. Other times, its just slow. A while ago some hard limits were added to some platform layers but these don't solve the problems very well. To solve this better, I've added some code to the LineLayout class that tries to break runs longer than 500 bytes into segments less than 100 bytes long in a consistent way. To avoid problems with multi-byte and combining characters, it tries first to break after a space and if no spaces are present breaks before low ASCII characters that should not be part of combinations (its currently wrong, testing < 'a' rather than < 'A'). This results in a large speed improvement (particularly on GTK+) where there are very wide lines of text that are not lexed into small runs because runs that are completely outside the drawing area do not go through any of the text drawing code. The code will currently fail on long runs containing only multi-byte characters.
SinkWorld has been using a position cache for a while now and this is now ported to Scintilla. The position cache holds a fixed size set of pieces of text along with the positions of each character relative to the start of the text. This is similar to the existing LineLayout cache but uses much less memory for good results. It decreases the number of calls to the platform layer's text measurement method by around 90% with 1024 entries. It only holds short (<30 character) pieces of text to avoid large memory use and churning the cache for pieces of text that only occur once. Wrapping all of SciTEBase.cxx on GTK+ takes around one quarter of the time that is required without the cache. When displaying large amounts of text in wrapped mode, using the LineLayout cache with the whole document cached gives much better results than using the PositionCache. Because the PositionCache adds complexity and overlaps the LineLayout cache, I'm not sure whether to commit this change. These two changes have not been committed but can be found in http://scintilla.sourceforge.net/scite.zip Neil _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
