From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Efficiently using MOVE_IT_... to gather a plethora of information. Date: Wed, 23 Aug 2017 21:08:28 +0300 Message-ID: <83ziaq88df.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1503511753 345 195.159.176.226 (23 Aug 2017 18:09:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 23 Aug 2017 18:09:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 23 20:09:08 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dka5J-0007kG-0B for ged-emacs-devel@m.gmane.org; Wed, 23 Aug 2017 20:08:57 +0200 Original-Received: from localhost ([::1]:45121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dka5P-0003Wi-QF for ged-emacs-devel@m.gmane.org; Wed, 23 Aug 2017 14:09:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dka5D-0003WS-Tr for emacs-devel@gnu.org; Wed, 23 Aug 2017 14:08:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dka59-0006Vo-5l for emacs-devel@gnu.org; Wed, 23 Aug 2017 14:08:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dka59-0006Vj-2G; Wed, 23 Aug 2017 14:08:47 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3768 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dka58-0003O5-5f; Wed, 23 Aug 2017 14:08:46 -0400 In-reply-to: (message from Keith David Bershatsky on Tue, 22 Aug 2017 13:17:38 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217729 Archived-At: > Date: Tue, 22 Aug 2017 13:17:38 -0700 > From: Keith David Bershatsky > Cc: emacs-devel@gnu.org > > 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.