From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: George Plymale II Newsgroups: gmane.emacs.devel Subject: Re: Loading a package applies automatically to future sessions? Date: Tue, 30 Jan 2018 17:33:25 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1517351675 13678 195.159.176.226 (30 Jan 2018 22:34:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Jan 2018 22:34:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 30 23:34:31 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 1egeTl-0002Fw-0v for ged-emacs-devel@m.gmane.org; Tue, 30 Jan 2018 23:34:13 +0100 Original-Received: from localhost ([::1]:40756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egeVl-0007gZ-Vt for ged-emacs-devel@m.gmane.org; Tue, 30 Jan 2018 17:36:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egeUd-0006yg-F1 for emacs-devel@gnu.org; Tue, 30 Jan 2018 17:36:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egeTA-00075D-EM for emacs-devel@gnu.org; Tue, 30 Jan 2018 17:35:07 -0500 Original-Received: from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:37556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egeTA-00073P-2U for emacs-devel@gnu.org; Tue, 30 Jan 2018 17:33:36 -0500 Original-Received: by mail-qt0-x233.google.com with SMTP id d54so19423481qtd.4 for ; Tue, 30 Jan 2018 14:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orbitalimpact.com; s=google; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version; bh=KSifF5JpvfktjCaKoo2Q1UgFrMtzlGAn+vtKexU16F8=; b=LOJSqP5mJ9n9//9EjOqZk04XU59onGlFwK9UqVuqy+Cmo126LuGsGxn6o5QBAq3TpR pR00g40BsFSAf7ExIMBPEu5PtOd+T3mS2qLRRDjTxjRyfdh1ZUJPnydhd+YZKIASmusx 5w3HFET9CMjQNU9rz3UyiG3eiUBp37LNJ2knY= 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:in-reply-to:date:message-id :mime-version; bh=KSifF5JpvfktjCaKoo2Q1UgFrMtzlGAn+vtKexU16F8=; b=nXrtZrop2JXQZwSxLLCHiBr4rJDEx8OAA/tlWrbGz4PMgc2E22z2PBGX8c6jYJmHN1 UUdmqW9oeCINSsSF4LTBka2kysGFe/zryLaCP6cT1Ez19OWDNpcYriZhHIK+YKJ3fgVT QNUAGpeYaAF+lltlqPnpS5FJLONmoODzN7qBN8krBP1hMWvXVkztukv7l6HpDRo4GX8y uoJYXpOnm40ibL+hpzlRW5A+tqm28TlyYIgX24XOFwb7Kanyik/4iQMvaEBEBPPdezG0 J58gWl9Mc9Ddg0I0dlp5E/oVvyhVdQxWkh9tml5pw62v7ZdX3/cnhPTj03jKqUECvuG5 +lMw== X-Gm-Message-State: AKwxytdWhWRdPQ/rGY7oZ2mvQ/K8a2gXZM679wucUCC2QRwzM7hZEFZJ LOQEZFjSfEgXSvCcDtppr3KTeLAN8yY= X-Google-Smtp-Source: AH8x226xXhMVbay72t+5akEMVdIGqH9xTcuE4izBPyacZ5O75wTqrllP4vreUpOXK/0w/NvusYg+Tw== X-Received: by 10.200.52.233 with SMTP id x38mr48774958qtb.267.1517351615057; Tue, 30 Jan 2018 14:33:35 -0800 (PST) Original-Received: from lehi.dev.orbitalimpact.com (ip-9-221-239-173.east.us.northamericancoax.com. [173.239.221.9]) by smtp.gmail.com with ESMTPSA id g1sm12688137qta.46.2018.01.30.14.33.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 14:33:34 -0800 (PST) In-Reply-To: (message from Stefan Monnier on Tue, 30 Jan 2018 10:11:58 -0500) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::233 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:222321 Archived-At: 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