From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Emacs/prelude: lag in opening big files Date: Fri, 21 Jul 2017 16:43:50 +0300 Message-ID: <83o9sdaort.fsf@gnu.org> References: <25646CD8-2C85-4840-B72F-8B2EE79D9349@agrarianresearch.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1500644701 22890 195.159.176.226 (21 Jul 2017 13:45:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Jul 2017 13:45:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 21 15:44:55 2017 Return-path: Envelope-to: geh-help-gnu-emacs@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 1dYYEg-0005VD-69 for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Jul 2017 15:44:54 +0200 Original-Received: from localhost ([::1]:43288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYYEk-0002YV-6K for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Jul 2017 09:44:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYYDq-0002UE-Px for help-gnu-emacs@gnu.org; Fri, 21 Jul 2017 09:44:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYYDm-0007Dh-RN for help-gnu-emacs@gnu.org; Fri, 21 Jul 2017 09:44:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYYDm-0007Da-O7 for help-gnu-emacs@gnu.org; Fri, 21 Jul 2017 09:43:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2128 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dYYDl-00027l-Uc for help-gnu-emacs@gnu.org; Fri, 21 Jul 2017 09:43:58 -0400 In-reply-to: <25646CD8-2C85-4840-B72F-8B2EE79D9349@agrarianresearch.org> (message from Vikas Rawal on Fri, 21 Jul 2017 07:37:55 +0530) 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:113807 Archived-At: > From: Vikas Rawal > Date: Fri, 21 Jul 2017 07:37:55 +0530 > > I am having a strange problem that I have never faced before. When I open (C-f) a large file, it gets stuck for a long time. I have to wait for eternity before the file would open. But if I C-g and cancel the process, and do it again, the second time, it opens in a snap. > I have tried it with many files, and it happens each time. If a file is opened and closed, and I want to open it again, emacs does the same thing all over again. That is, slow to open first time, but opens in a snap if I C-g and start again. > > How do I debug this? I tried to use profiler to figure out where was emacs stuck. Below is the main part of the report on cpu usage when I tried to open a large org mode file. Looks like helm is one of the culprits. Is this usual? Is there a way to deal with this? > > Vikas > > > > > - command-execute 6903 57% > - call-interactively 6903 57% > - funcall-interactively 6575 54% > - helm-find-files 6575 54% > - helm-find-files-1 6575 54% > - helm 6575 54% > - apply 6575 54% > - helm 6575 54% > - apply 6575 54% > - helm-internal 6575 54% > - helm-execute-selection-action 6103 50% > - helm-execute-selection-action-1 6103 50% > - helm-find-file-or-marked 6102 50% > - apply 6102 50% > + # 6102 50% > + helm-get-actions-from-current-source 1 0% You stopped expanding the profile too early: you should continue expanding "#" and the levels below it, until you find a significant change in the percentage -- that is where most of the CPU processing is spent. (My guess would be it's org-indent-add-properties, but that's just a guess.) For more accurate profile, load all the libraries involved in this as *.el files, not as *.elc. (This should probably be a bug report.)