From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: raman@google.com (T.V Raman) Newsgroups: gmane.emacs.devel Subject: Re: Loading a package applies automatically to future sessions? Date: Tue, 30 Jan 2018 19:51:30 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1517370596 30349 195.159.176.226 (31 Jan 2018 03:49:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Jan 2018 03:49:56 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: George Plymale II Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 31 04:49:52 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 1egjP3-00070B-T0 for ged-emacs-devel@m.gmane.org; Wed, 31 Jan 2018 04:49:42 +0100 Original-Received: from localhost ([::1]:58842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egjR4-0002xu-5l for ged-emacs-devel@m.gmane.org; Tue, 30 Jan 2018 22:51:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egjQw-0002xl-V7 for emacs-devel@gnu.org; Tue, 30 Jan 2018 22:51:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egjQt-0007wb-RG for emacs-devel@gnu.org; Tue, 30 Jan 2018 22:51:39 -0500 Original-Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:44414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egjQt-0007ub-KT for emacs-devel@gnu.org; Tue, 30 Jan 2018 22:51:35 -0500 Original-Received: by mail-pf0-x22f.google.com with SMTP id 17so9834254pfw.11 for ; Tue, 30 Jan 2018 19:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=I+oB3C5fkaKmWxvCKXZ5fMV/vZYbeuYqaKh5zIYku08=; b=BhZF5kClyHujo1HEpzERUkUMT9HcT1U+oD/cp11cpOI00WtRjOI/vpKglh/4okhIVl mrFOTWQu+tQQHMxyTdkue2F5diw8y0bsZnYSKlOndNWlhxQ/Pa44wnENSXhB0xXb4Gnn JxGeCAQRSae+otLaPQa9/6EAIXHtHnbO6Nhw5aEJur+2xccxKrO0VF/EbhT3xAmDc+Kr obqr6hS6GIxJX/VyhOX0Cry3u4lpB97f4pV0da889zj2sG4TMB5RR+ZQs6HCouNGKPpM qCxVGx5EDJoLgWDm2vSuugq3Z6hmeMPTWytahUwJoPs6vAlS8gbQJzVIwyEi9dgaJY+b uEyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=I+oB3C5fkaKmWxvCKXZ5fMV/vZYbeuYqaKh5zIYku08=; b=je0vw+vR2vjDtqMbPcqfHMyksyutXxSKUZq6tXdGuI1fTiplRJfQ/h+cihdr2jgoZF fTa6VAg3/Q2wRyTUzeYDg5MBtWJkncTeYzfBId9ByU4C1/F8XkGMkN+rcwSVYLlSnk66 5x0zgAr4PZ/g3/kMki4SZ89j09SiYUHy+uYB3nefL63fbrxPrxxGnciUwyWk5Zy2AShq zrApENjZIsLWk5HSsUBRGr9x0Ms8QSmQu40l8Dbif/ciCnz+30qcx9342vLL2HKcPaVD gWJ74BEoGU3vcY/B2RdLRy/JyezP8+kr3cT879LKtZqCdvtANfedObn2+0dNA4N+d5ws FQ0g== X-Gm-Message-State: AKwxyte7goFVw/yLkUPqVYAhVT0kcgJFnu8iF7q3jEjUrWmExgQbiJpi kNVo9Cg9V9iKti7Rgo2mBEwayz/hZow= X-Google-Smtp-Source: AH8x225w0f74egqgsJ5HgkDZ8h7fjhUA5MEFOmyMWqjuvWkc0q+Zj7NXSx0WZHAzO7zYmFK+J+XKMQ== X-Received: by 10.98.161.16 with SMTP id b16mr32588435pff.34.1517370693333; Tue, 30 Jan 2018 19:51:33 -0800 (PST) Original-Received: from raman-glaptop (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id e185sm41706151pfg.155.2018.01.30.19.51.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 19:51:32 -0800 (PST) In-Reply-To: (George Plymale, II's message of "Tue, 30 Jan 2018 17:33:25 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22f 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:222327 Archived-At: George Plymale II writes: try let-binding file-name-handler-alist to nil -- in my case, that gave a significant speed-up a few months ago > Hi all, > > I'm the one who posted the question on Stack Exchange, which Stefan > mentioned the other day. My specific question is detailed here: > https://emacs.stackexchange.com/q/38368/10761 > > So, I've tried out Stefan's patch and it's definitely an improvement on > startup time, but the improvement is not huge for me. Specifically, I've > done the following in my startup files: > > (setq package-enable-at-startup nil) > (load "~/.emacs.d/package-fastpath.el") > (setq package--initialized t) > > I put that code in my files after running Stefan's > `package-fastpath-refresh'. I also set `load-source-file-function' to > nil as per Stefan's suggestion. Unfortunately, I couldn't byte-compile > my package-fastpath.el file due to some packages which already > byte-compile their autoload files, such as SLIME. > > Now, I do see some improvement in my startup time, but to reiterate, it > is not huge. When I run Emacs with my startup commented out, > `emacs-init-time' yields 1.2 seconds. When I run it with my startup > intact, it yields 1.3 or 1.4 seconds. This contrasts with my previous > `emacs-init-time' which was 1.6 or 1.7 seconds, but as you can see, it's > not a really big difference. > > It is possible that this sub-par time is due to something on my own > system, but I'm not sure nor convinced of that. Moreover, Stefan's patch > certainly can use some improvements and some notes on how to use his > changes, as it is a bit vexing to figure it out by reading the diff ;) > > I did notice a few bugs with Stefan's changes. One bug was that > `package-installed-p' no longer yields correct results on installed > packages. I believe that this is because `package-desc-p' is also broken > by these changes. This broke some code in my startup which I used to > check whether I need to install new packages. > > Another bug was that some packages were placed in bad order in > package-fastpath.el. In other words, if a dependency's autoloads are > written to this file after its dependent package, the dependent package > will err, saying that it couldn't require one of its dependencies. There > is obviously some work to do on making sure that dependencies are placed > in the correct order or to change the code so that package-fastpath.el > is order-agnostic. > > As a side note and a bit of an opinion, Radon Rosborough made an > interesting remark in one of his messages. He mentioned pip and how > things are done in Python, which really struck me. You never really > think about using a package in a language like Python or Ruby. You just > `require' or `import' it and that's that. It's really simple and the > amount of packages that you have never hurts the startup of the main > program. I know that Emacs is a bit more complicated since it's more of > a text editor than a language and we have somewhat more intricacies to > worry about. But I think that this kind of a model is the kind we need > to be headed for. > > A user should be able to have a million packages and not have to worry > about the subsequent startup time. Heck, in my own Ruby installation I > have 436 gems and I've never even thought about startup time till now. > > In any case, I think Stefan's ideas and proposed changes are a good idea > and I am in much the same boat as John Wiegley in that I restart Emacs > often enough that startup time gets on my nerves. So I hope that we'll > have some real progress on this issue and make package.el more robust. > > Thanks, > - George Plymale II > --