From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jiaxin Cao Newsgroups: gmane.emacs.help Subject: Re: Why emacs rendering is slow when encountering long lines? Date: Sun, 20 Oct 2013 19:08:51 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1382321414 32468 80.91.229.3 (21 Oct 2013 02:10:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2013 02:10:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 21 04:10:19 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VY4wk-00042W-TY for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Oct 2013 04:10:19 +0200 Original-Received: from localhost ([::1]:38001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VY4wj-0002vz-Tt for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Oct 2013 22:10:17 -0400 X-Received: by 10.236.41.100 with SMTP id g64mr13854651yhb.31.1382321332303; Sun, 20 Oct 2013 19:08:52 -0700 (PDT) X-Received: by 10.50.87.71 with SMTP id v7mr175140igz.11.1382321332227; Sun, 20 Oct 2013 19:08:52 -0700 (PDT) Original-Path: usenet.stanford.edu!o2no16568023qas.0!news-out.google.com!9ni62895qaf.0!nntp.google.com!i2no24112895qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=167.220.232.157; posting-account=TLmnjwoAAACUjiKEXP3QKKOm1UObeV3K Original-NNTP-Posting-Host: 167.220.232.157 User-Agent: G2/1.0 Injection-Date: Mon, 21 Oct 2013 02:08:52 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:201851 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94120 Archived-At: On Monday, October 21, 2013 12:09:26 AM UTC+8, Allan Streib wrote: > Jiaxin Cao writes: >=20 >=20 >=20 > > When I open a file containing long lines, it is not smooth to scroll up= and down, even if the file is not large.=20 >=20 >=20 >=20 > Have you tried enabling truncate-lines? I realize this is a matter of >=20 > subjective preference, but I generally prefer this for any programming >=20 > modes (I only wrap long lines for reading text e.g. email) >=20 >=20 >=20 > Allan Yes, I tried both cases with truncate-lines enabled and disabled. Scroll-do= wn is bad in both cases. Scroll-up behaves a little better.=20 Let me provide more information about this. To reproduce the scenario, just= create a line containing about 450 chars, and copy the line 10000 times. I= use the text-mode to test this buffer. Scroll-down means the cursor goes u= p. My OS is windows 8. Emacs version is 24.3.1. I think this is not the problem of the rendering engine. You can do some te= sts like this.=20 (defun test-redraw-display () (interactive) (message (format-time-string "%Y-%m-%dT%T:%6N")) (redraw-display) (message (format-time-string "%Y-%m-%dT%T:%6N"))) (defun test-scroll-down () (interactive) (message (format-time-string "%Y-%m-%dT%T:%6N")) (scroll-down) (message (format-time-string "%Y-%m-%dT%T:%6N"))) (defun test-scroll-up () (interactive) (message (format-time-string "%Y-%m-%dT%T:%6N")) (scroll-up) (message (format-time-string "%Y-%m-%dT%T:%6N"))) Here is the test results on the buffer mentioned above. |-------------------------+----------------+-------------+-----------| | | redraw-display | scroll-down | scroll-up | |-------------------------+----------------+-------------+-----------| | Truncate-lines enabled | < 1ms | 82ms | 47ms | | Truncate-lines disabled | < 1ms | 76ms | 54ms | |-------------------------+----------------+-------------+-----------| Based on the results, I guess the scroll-down is the bottleneck of the scro= lling performance. I know scroll-down is a little complicated to implement,= but if you do the same thing in notepad, you'll find notepad is way smoot= her than emacs in term of scrolling.