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: Sat, 16 Jun 2018 15:06:49 +0200 Message-ID: <87y3fedgnq.fsf@tu-berlin.de> References: <87zhzvc9km.fsf@tu-berlin.de> <83r2l7yn52.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529154306 28088 195.159.176.226 (16 Jun 2018 13:05:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2018 13:05:06 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 16 15:05:02 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 1fUAt1-00076M-IY for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2018 15:04:59 +0200 Original-Received: from localhost ([::1]:51547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUAv8-0006HV-PU for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2018 09:07:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUAux-0006HQ-Iw for emacs-devel@gnu.org; Sat, 16 Jun 2018 09:07:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUAuw-0006Kj-KJ for emacs-devel@gnu.org; Sat, 16 Jun 2018 09:06:59 -0400 Original-Received: from exchange.tu-berlin.de ([130.149.7.70]:50637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUAur-0006Di-RZ; Sat, 16 Jun 2018 09:06:54 -0400 Original-Received: from SPMA-01.tubit.win.tu-berlin.de (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 6C57E7DDAD2_B250B6AB; Sat, 16 Jun 2018 13:06:50 +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-01.tubit.win.tu-berlin.de (Sophos Email Appliance) with ESMTPS id 043087DB3FA_B250B6AF; Sat, 16 Jun 2018 13:06:50 +0000 (GMT) Original-Received: from corax (178.199.231.181) by ex-mbx-10.tubit.win.tu-berlin.de (172.26.35.180) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Sat, 16 Jun 2018 15:06:49 +0200 In-Reply-To: <83r2l7yn52.fsf@gnu.org> X-ClientProxiedBy: EX-CAS-02.tubit.win.tu-berlin.de (172.26.35.182) 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.51 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:226357 Archived-At: On Sa, Jun 16 2018, Eli Zaretskii wrote: >> If I understand correctly "follow-calc-win-end" would be the function >> that uses most of cpu time. > > Yes, it looks like that. For even more detailed results, repeat the > experiment after loading the uncompiled follow.el. Thanks Eli, So what I did was: 1. M-x load-file RET path-to-follow.el.gz RET 2. M-x profiler start 3. edit text 4. M-x profiler-report Results do indeed look slightly different: - follow-post-command-hook 140786 88% - if 140440 88% - let 140440 88% - save-current-buffer 140440 88% - follow-adjust-window 140436 88% - if 140436 88% - progn 140436 88% - let 140418 88% - let* 140340 88% - if 140327 87% - follow-redisplay 114860 72% - let* 114860 72% - cond 104536 65% - follow-calculate-first-window-start-from-above 104536 65% - save-excursion 104536 65% - let 104536 65% - while 104536 65% - if 104536 65% - setq 103381 64% - follow-calc-win-start 103381 64% - while 103381 64% - let 103378 64% - setq 103349 64% - car 103349 64% - follow-calc-win-end 103346 64% - apply 103346 64% - # 103329 64% - apply 103322 64% - # 103313 64% - let* 103310 64% posn-point 51699 32% + if 51546 32% + window-inside-pixel-edges 47 0% + 3 0% set-window-start 4 0% + and 3 0% + not 1155 0% + let 4361 2% + follow-calc-win-start 3289 2% + follow-estimate-first-window-start 2674 1% - setq 20770 13% - follow-windows-start-end 20770 13% - if 20770 13% - let 20770 13% - let 20770 13% - while 20770 13% - setq 20770 13% - cons 20770 13% - cons 20770 13% - cons 20770 13% - follow-calc-win-end 20767 13% - apply 20767 13% + # 20763 13% + let 4635 2% + if 62 0% + progn 13 0% + if 67 0% + follow-all-followers 11 0% + follow-avoid-tail-recenter 18 0% + if 4 0% + follow-adjust-window 346 0% + command-execute 9690 6% > If you "show all" in the Org buffer, do the lags become significantly > smaller? Yes, the difference is VERY significant; but I guess this is because with collapsed headings, there is A LOT more text within the boundaries of my frame, than with show-all. Gerald. --------------------- Sent with mu4e