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 15:53:55 +0200 Message-ID: <87efh2naq4.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 1529417093 8922 195.159.176.226 (19 Jun 2018 14:04:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2018 14:04:53 +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 16:04:49 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 1fVHFY-0002Cg-K3 for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 16:04:48 +0200 Original-Received: from localhost ([::1]:42835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVHHf-0006la-PT for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 10:06:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVH6C-0005Pq-3j for emacs-devel@gnu.org; Tue, 19 Jun 2018 09:55:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVH6A-0003KW-Vn for emacs-devel@gnu.org; Tue, 19 Jun 2018 09:55:08 -0400 Original-Received: from exchange.tu-berlin.de ([130.149.7.70]:26546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVH66-0003FV-Oo; Tue, 19 Jun 2018 09:55:03 -0400 Original-Received: from SPMA-04.tubit.win.tu-berlin.de (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 995EC972452_B290B32B; Tue, 19 Jun 2018 13:54:58 +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-04.tubit.win.tu-berlin.de (Sophos Email Appliance) with ESMTPS id 90B58970246_B290B31F; Tue, 19 Jun 2018 13:54:57 +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 15:54:57 +0200 In-Reply-To: <83d0wptpmu.fsf@gnu.org> X-ClientProxiedBy: EX-MBX06.tubit.win.tu-berlin.de (172.26.35.176) 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:226505 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