From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What makes set-window-buffer slow? Date: Thu, 23 Jun 2016 22:11:48 +0300 Message-ID: <83fus33ekr.fsf@gnu.org> References: <576C04E4.9040000@gmail.com> <576C2054.3020705@gmail.com> <20160623181242.GB4946@acm.fritz.box> <576C2AAA.1090707@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1466709193 28675 80.91.229.3 (23 Jun 2016 19:13:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2016 19:13:13 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org, schwab@suse.de To: =?windows-1252?Q?Cl=E9ment?= Pit--Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 23 21:13:08 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bGA3m-0004PT-Vi for ged-emacs-devel@m.gmane.org; Thu, 23 Jun 2016 21:13:07 +0200 Original-Received: from localhost ([::1]:38857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGA3m-000447-47 for ged-emacs-devel@m.gmane.org; Thu, 23 Jun 2016 15:13:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGA3d-00040d-Tu for emacs-devel@gnu.org; Thu, 23 Jun 2016 15:12:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGA3Y-0002EV-3a for emacs-devel@gnu.org; Thu, 23 Jun 2016 15:12:56 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGA3Y-0002Dd-1D; Thu, 23 Jun 2016 15:12:52 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3329 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bGA3U-00082b-7B; Thu, 23 Jun 2016 15:12:49 -0400 In-reply-to: <576C2AAA.1090707@gmail.com> (message from =?windows-1252?Q?C?= =?windows-1252?Q?l=E9ment?= Pit--Claudel on Thu, 23 Jun 2016 14:30:02 -0400) 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:204704 Archived-At: > From: Clément Pit--Claudel > Date: Thu, 23 Jun 2016 14:30:02 -0400 > Cc: Andreas Schwab , Emacs developers > > > On Thu, Jun 23, 2016 at 01:45:56PM -0400, Clément Pit--Claudel wrote: > >> Thanks for this suggestion! I probably have to investigate why > >> redisplay is slow, then; that's bound to be rather tricky :/ > > > > Redisplay is NOT slow. It's written in C and is heavily optimised. > > Thanks for the clarification! Do you know what else might make set-window-buffer slow? > > >> Is there a reason for set-window-buffer to trigger redisplay if the window was already displaying that same buffer? > > > > I can't answer your exact question, but should redisplay get triggered > > in these circumstances, its optimisations would ensure that the reusable > > part of the display would, in fact, get reused. > > Nifty. Thanks! Instead of hypothesizing, I suggest to profile your code with profiler.el. If indeed redisplay is taking the time, you should see that in the profile.