[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficiently using MOVE_IT_... to gather a plethora of information.

From: Eli Zaretskii
Subject: Re: Efficiently using MOVE_IT_... to gather a plethora of information.
Date: Wed, 23 Aug 2017 21:08:28 +0300

> Date:  Tue, 22 Aug 2017 13:17:38 -0700
> From:  Keith David Bershatsky <address@hidden>
> Cc:  address@hidden
> I have been gathering data for each screen line at all three (3) locations 
> and storing that data in a list -- I'll call this "the whopper/everything".  
> Once all of the data is gathered, I iterate over each element of the list and 
> see whether certain criteria is met -- e.g., this element is for the 
> beginning of a line, so put line numbers; this element is for the end of a 
> line, so put pilcrows and maybe part of a floating vertical line (tracking 
> the cursor position); this element is aligned with the real cursor and we are 
> in the middle of a line of text, so draw a portion of thin vertical line 
> through the text (tracking the cursor position).

IMO, this design is sub-optimal, and will necessarily cause slowdown,
sometimes a very serious one.  What you should do instead is generate
your numbers, pilcrows, and thin lines as part of the basic layout
code in display_line.  That is, do that on the fly, whenever
display_line gets to the point where you need to produce something
special.  Doing that as an after-thought, in a separate cycle that
follows redisplay is bound to be slow.  The native line numbers are
much faster than linum.el and similar packages precisely because it
produces line numbers on the fly, whenever the lines are laid out.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]