From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gerald Wildgruber Newsgroups: gmane.emacs.devel Subject: Re: follow-mode: extremely slow in combination with org-mode Date: Tue, 19 Jun 2018 14:08:44 +0200 Message-ID: <87bmc79dwz.fsf@tu-berlin.de> References: <87zhzvc9km.fsf@tu-berlin.de> <83r2l7yn52.fsf@gnu.org> <87y3fedgnq.fsf@tu-berlin.de> <838t7ezokb.fsf@gnu.org> <877emx3not.fsf@tu-berlin.de> <83lgbdu8zs.fsf@gnu.org> <20180617111333.GA12093@ACM> <83k1qxtvkt.fsf@gnu.org> <87tvq1qx6n.fsf@tu-berlin.de> <83d0wptpmu.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529410218 23975 195.159.176.226 (19 Jun 2018 12:10:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2018 12:10:18 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: acm@muc.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 14:10:14 2018 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 1fVFSf-00065m-U7 for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 14:10:14 +0200 Original-Received: from localhost ([::1]:41200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVFUj-0003nk-EO for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 08:12:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVFSO-0002uv-PS for emacs-devel@gnu.org; Tue, 19 Jun 2018 08:09:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVFSN-0003uk-Ph for emacs-devel@gnu.org; Tue, 19 Jun 2018 08:09:56 -0400 Original-Received: from exchange.tu-berlin.de ([130.149.7.70]:49893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVFSJ-0003ol-Ro; Tue, 19 Jun 2018 08:09:52 -0400 Original-Received: from SPMA-03.tubit.win.tu-berlin.de (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 7A97C6DF2E_B28F281B; Tue, 19 Jun 2018 12:09:37 +0000 (GMT) Original-Received: from exchange.tu-berlin.de (exchange.tu-berlin.de [130.149.7.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "exchange.tu-berlin.de", Issuer "DFN-Verein Global Issuing CA" (not verified)) by SPMA-03.tubit.win.tu-berlin.de (Sophos Email Appliance) with ESMTPS id 585436992B_B28F280F; Tue, 19 Jun 2018 12:09:36 +0000 (GMT) Original-Received: from krios (130.149.43.226) by ex-mbx-10.tubit.win.tu-berlin.de (172.26.35.180) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 19 Jun 2018 14:09:35 +0200 In-Reply-To: <83d0wptpmu.fsf@gnu.org> X-ClientProxiedBy: EX-MBX-04.tubit.win.tu-berlin.de (172.26.35.174) To ex-mbx-10.tubit.win.tu-berlin.de (172.26.35.180) X-PMWin-Version: 4.0.1, Antivirus-Engine: 3.72.1, Antivirus-Data: 5.52 X-PureMessage: [Scanned] X-SASI-RCODE: 200 X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy] X-Received-From: 130.149.7.70 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:226498 Archived-At: Hi I tried the patched follow.el (the one that contains the modified follow-calc-win-end) on my somewhat slower (but also new quad core) office machine, unfortunately no amelioration of lag was noticeable. Same procedure: patching follow.el, starting the profiler, loading the patched uncompiled version into emacs via M-x load-file and finally start editing. The lag remains enormous (e.g. more than a second lag between typing RET and seeing a newline on screen); I noticed however, that upon typing RET one time, the newline comes almost immediately; but after typing more RETs they take ages to appear on screen. Bizarrely, this happened also: redisplay takes very long and it apparently aborts leaving paragraphs before point unfilled, one long line of text (I always use auto-fill-mode). On So, Jun 17 2018, Eli Zaretskii wrote: > Each character you insert triggers redisplay, and I'm guessing > follow-mode has many of the redisplay optimizations disabled. Actually, I had no idea. I tried to understand what "redisplay" is (by reading the comments at the beginning of emacs/src/xdisp.c) and the more I read, the less I am surprised it takes so long! :-) Why might those optimizations have been disabled on follow-mode? > But it may be interesting to see a profile when all you do is type > self-inserting characters, maybe we will learn something important > from that. Here is another profile, now on my office machine with only self-inserting commands, i.e. typing just "normal" letters: - follow-post-command-hook 54982 61% - if 54982 61% - let 54975 61% - save-current-buffer 54975 61% - follow-adjust-window 54975 61% - if 54972 61% - progn 54972 61% - let 53646 59% - let* 53646 59% - if 53646 59% - follow-redisplay 49062 54% - let* 49062 54% - cond 43568 48% - follow-calculate-first-window-start-from-above 43568 48% - save-excursion 43568 48% - let 43568 48% - while 43564 48% - if 43564 48% - setq 42813 47% - follow-calc-win-start 42813 47% - while 42813 47% - let 42802 47% - setq 42789 47% - car 42789 47% - follow-calc-win-end 42785 47% - let 42785 47% - save-current-buffer 42785 47% - unwind-protect 42785 47% - progn 42777 47% - let* 42767 47% + setq 10 0% + window-end 4 0% + and 7 0% + not 747 0% if 4 0% + follow-calc-win-start 3062 3% + follow-estimate-first-window-start 1410 1% + let 1022 1% - let 4574 5% - redisplay 4570 5% - redisplay_internal (C function) 17 0% - eval 11 0% if 8 0% mode-line-eol-desc 3 0% + follow-avoid-tail-recenter 7 0% if 3 0% + follow-windows-start-end 1326 1% + progn 3 0% + follow-post-command-hook 3 0% + command-execute 27012 30% Anything else to try to get a faster follow-mode? Thanks Gerald. --------------------- Sent with mu4e