From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.help Subject: Re: How to profile restoring from .emacs.desktop Date: Fri, 29 Jan 2021 23:05:04 +0100 Message-ID: <86k0rvmmb3.fsf@dod.no> References: <864kj2nw2s.fsf@dod.no> <86v9bhlzky.fsf@dod.no> <86o8h8n165.fsf@dod.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23616"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 29 23:06:11 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5bu6-00062X-Es for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 29 Jan 2021 23:06:10 +0100 Original-Received: from localhost ([::1]:46616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5bu5-0005Ci-Hk for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 29 Jan 2021 17:06:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5btT-0005CG-IS for help-gnu-emacs@gnu.org; Fri, 29 Jan 2021 17:05:32 -0500 Original-Received: from cadalora.default.sbang.uk0.bigv.io ([46.43.15.90]:33398) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5btN-0007qz-3C for help-gnu-emacs@gnu.org; Fri, 29 Jan 2021 17:05:31 -0500 Original-Received: from mccoy (cm-84.210.87.211.getinternet.no [84.210.87.211]) by cadalora.default.sbang.uk0.bigv.io (Postfix) with ESMTPSA id 846FCCD422 for ; Fri, 29 Jan 2021 22:05:06 +0000 (GMT) In-Reply-To: (Stefan Monnier's message of "Thu, 28 Jan 2021 17:58:07 -0500") Received-SPF: none client-ip=46.43.15.90; envelope-from=sb@dod.no; helo=cadalora.default.sbang.uk0.bigv.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:127437 Archived-At: >>>>> Stefan Monnier : > You might want to file a bug report with the maintainer of Projectile, then. > Clearly, your profile indicates that it's doing "too much work". Turns out this was a user error. I had this setting in ~/.emacs: (setq projectile-project-search-path '("~/workspaces/" "~/git/")) This causes projectile to scan all of the subdirectories of those directories for project on startup. And there are a *lot* of project directories to scan under those! When I removed this setting (defaults to nil), desktop restored in a much shorter time. Here's the results of profiler-report from desktop restore, opened on the interesting nodes: - normal-top-level 20214 91% - command-line 20214 91% - command-line-1 20206 91% - eval 20206 91% - progn 20206 91% - desktop-read 20206 91% - load 20040 90% - load-with-code-conversion 20040 90% - eval-buffer 20026 90% - desktop-create-buffer 19978 90% - desktop-restore-file-buffer 8029 36% - find-file-noselect 7865 35% - find-file-noselect-1 4813 21% - after-find-file 4621 20% + run-hooks 2564 11% + normal-mode 2020 9% + auto-save-mode 20 0% + file-truename 134 0% + insert-file-contents 17 0% abbreviate-file-name 4 0% + create-file-buffer 433 1% + find-buffer-visiting 292 1% + file-truename 210 0% abbreviate-file-name 42 0% + switch-to-buffer 147 0% + projectile-mode 5696 25% + dired-restore-desktop-buffer 3839 17% + bury-buffer 1411 6% + rename-buffer 466 2% + desktop-load-file 359 1% + auto-revert-mode 62 0% + flycheck-mode 12 0% visual-line-mode 6 0% editorconfig-mode 5 0% buffer-list 2 0% + internal-macroexpand-for-load 12 0% + do-after-load-evaluation 12 0% + desktop-restore-frameset 162 0% + byte-code 4 0% + lisp-interaction-mode 4 0% + ... 1360 6% + timer-event-handler 486 2% + command-execute 98 0% + redisplay_internal (C function) 34 0% + flycheck-handle-signal 4 0%