From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 15 12:35:20 2014 Received: (at submit) by debbugs.gnu.org; 15 Dec 2014 17:35:20 +0000 Received: from localhost ([127.0.0.1]:47130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0ZYF-0002L9-OG for submit@debbugs.gnu.org; Mon, 15 Dec 2014 12:35:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46684) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0ZYD-0002Ks-9t for submit@debbugs.gnu.org; Mon, 15 Dec 2014 12:35:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0ZY1-0001d0-W6 for submit@debbugs.gnu.org; Mon, 15 Dec 2014 12:35:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ZY1-0001cu-TV for submit@debbugs.gnu.org; Mon, 15 Dec 2014 12:35:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ZXv-0006UD-U8 for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 12:35:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0ZXp-0001Py-Va for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 12:34:59 -0500 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:46767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ZXp-0001Pl-PH for bug-gnu-emacs@gnu.org; Mon, 15 Dec 2014 12:34:53 -0500 Received: by mail-wi0-f179.google.com with SMTP id ex7so9856321wid.6 for ; Mon, 15 Dec 2014 09:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=m90KPC7lwcTksZGBRaWlFacO6kgeRX8gLYT5B6GM/Jg=; b=uKu75bjczyy+LcG4SVF0SYbjlpOXam6t/ToooXxmXlkf252l4vq0LPQBK3WUNi3dpR 4l+rpfHHL0wqP/ZdmLtihrQL62GM2YowizWorhw9oHq1UY4OWgHMGyXhdeFXfDoEDiiW l6Vcxh8BuhoUkBFezBuHFyTnED6qlWo8mbb1ZwqxO1jZzILDb395GOrLndS9qrfN4v5B C6CnnsF86M9fqyrCXG1ioYkle04AfwFdq1CmGl8slJGGEsQ2o85kcAca1Qxi8z/2chmx O/7B5cwQo2Fs8Y+xFFpx/Utnx5SJNRMMx7t+TVElnS9JvRP0IhGY29P9fbexvvdl7E7L CNnQ== X-Received: by 10.180.8.202 with SMTP id t10mr33888301wia.15.1418664893183; Mon, 15 Dec 2014 09:34:53 -0800 (PST) Received: from axl (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id je12sm14022784wic.22.2014.12.15.09.34.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 09:34:52 -0800 (PST) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 25.0.50; `package-activate' is too slow Date: Mon, 15 Dec 2014 19:34:50 +0200 Message-ID: <86a92oddfp.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Before c13baa10d55ec863d3ceaea48c6b2959ece98198, `package-initialize' takes ~100 ms on my machine, with 92 packages. After this revision, it takes ~7.7 seconds. Provided there's no obvious low-hanging fruit for performance improvement, we should at least avoid exercising the new logic when Emacs is just launching. There's simply nothing to reload yet. In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-12-14 on axl Repository revision: eaf25ad549dc5a9b26089f588e0a80268708a3d1 Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 15 19:42:02 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 00:42:02 +0000 Received: from localhost ([127.0.0.1]:47302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0gDC-0004US-Ax for submit@debbugs.gnu.org; Mon, 15 Dec 2014 19:42:02 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:51567) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0gDB-0004UC-1J for 19390@debbugs.gnu.org; Mon, 15 Dec 2014 19:42:01 -0500 Received: by mail-wg0-f46.google.com with SMTP id x13so16039991wgg.5 for <19390@debbugs.gnu.org>; Mon, 15 Dec 2014 16:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=px/ADO95XOrWidXm+tMYZ4LG8OZtPmyS6n7U6TfFCkg=; b=O7FFzu/QrtkzN1adTS97yO4kXkagO/sT5811IuCITlDPsMHRQ90zRjnQQotWBXA4kH w8f+/ELf+UguY5JrMJtVJndU8F5rAfbq16EKsDEIUm7Gc2q7unBWXxDl4I7UPYH4X+oz 7pngg/SBlcvJ5K3c3dzuQZCVdENjimsMNYZPbhWmuwqSieSa+ly0QAt9ROCoaFHGWz1G P09QC79lZWMUFC8H5qCV2O+7bXjb20Zb9cQysgx127wHnt96TyPuvBCuYpHqKFimdXM3 PZrE+hrDlTgRs85e6BHRZ0F4ikxX8+bcZiGOiyLjiYc41KFKGftPNOnkp+tGMUP+iQ+r EMrg== X-Received: by 10.180.211.2 with SMTP id my2mr20234wic.3.1418690520332; Mon, 15 Dec 2014 16:42:00 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id fo12sm14986732wic.19.2014.12.15.16.41.59 for <19390@debbugs.gnu.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Dec 2014 16:41:59 -0800 (PST) Message-ID: <548F7FD6.9040203@yandex.ru> Date: Tue, 16 Dec 2014 02:41:58 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: 19390@debbugs.gnu.org Subject: Re: bug#19390: Acknowledgement (25.0.50; `package-activate' is too slow) References: <86a92oddfp.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 19390 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) Here's one possible fix. We don't deal with the slowness of `package--list-loaded-files' at all, and instead only load them if `package-activate' had been called with non-nil second argument (which only happens now if the package is installed). This also changes the way `package-activate' calls itself recursively on dependencies: instead of always passing the version as the second argument, pass the same value of FORCE it's been called with. Passing the version seems to be a remnant of older code. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index cd948ae..394efc3 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -516,7 +516,7 @@ Return the max version (as a string) if the package is held at a lower version." force)) (t (error "Invalid element in `package-load-list'"))))) -(defun package-activate-1 (pkg-desc) +(defun package-activate-1 (pkg-desc &optional force) (let* ((name (package-desc-name pkg-desc)) (pkg-dir (package-desc-dir pkg-desc)) (pkg-dir-dir (file-name-as-directory pkg-dir))) @@ -527,7 +527,7 @@ Return the max version (as a string) if the package is held at a lower version." (let* ((old-lp load-path) (autoloads-file (expand-file-name (format "%s-autoloads" name) pkg-dir)) - (loaded-files-list (package--list-loaded-files pkg-dir))) + (loaded-files-list (and force (package--list-loaded-files pkg-dir)))) (with-demoted-errors (format "Error loading %s: %%s" name) (load autoloads-file nil t)) (when (and (eq old-lp load-path) @@ -636,14 +636,14 @@ If FORCE is true, (re-)activate it if it's already activated." (fail (catch 'dep-failure ;; Activate its dependencies recursively. (dolist (req (package-desc-reqs pkg-vec)) - (unless (package-activate (car req) (cadr req)) + (unless (package-activate (car req) force) (throw 'dep-failure req)))))) (if fail (warn "Unable to activate package `%s'. Required package `%s-%s' is unavailable" package (car fail) (package-version-join (cadr fail))) ;; If all goes well, activate the package itself. - (package-activate-1 pkg-vec))))))) + (package-activate-1 pkg-vec force))))))) (defun define-package (_name-string _version-string &optional _docstring _requirements From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 07:32:26 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 12:32:26 +0000 Received: from localhost ([127.0.0.1]:47540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0rIf-0006Us-SO for submit@debbugs.gnu.org; Tue, 16 Dec 2014 07:32:26 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:38868) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0rIe-0006Ui-1G for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 07:32:24 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so12305905wiw.16 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 04:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=sXXErTOmALLgdXFQxE5gHea+OhO1Y5/JnrWHd0tD+oI=; b=BEi3o60O6ET8OL6it14DRAMHlwFQB8YTO2PCddZSrLdAzsDZznqYvG/WiN6GVexe5h vXG+gge5mjfRROgMw+qjEVcT5gU3TqbRjy6cAbab+lFpg4gZeiqgQr7TQQi5MoJIJag/ saXy50mN0tfZxrf1oPHAVMtbO5cxPeTIwB7xIo5a5dGhCdN5zhv6HOumcz1C1l/FBulz muBCmrw+wyriQbmGvee1BB1BJPQosou0CgH4eEqCEJ3EshbEKms03WAKwfWMEwW8mD9/ Hx+Y35HP30WF1w/n6cWgmdduTszrYHKCBxRY4rI9fzCwBoPmeaZpCit95WhBczjWgexE XR9Q== X-Received: by 10.194.71.203 with SMTP id x11mr61741398wju.131.1418733143492; Tue, 16 Dec 2014 04:32:23 -0800 (PST) Received: from axl ([82.102.93.58]) by mx.google.com with ESMTPSA id lg7sm2003170wic.0.2014.12.16.04.32.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 04:32:23 -0800 (PST) From: Dmitry Gutov To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> Date: Tue, 16 Dec 2014 14:32:16 +0200 In-Reply-To: <86a92oddfp.fsf@yandex.ru> (Dmitry Gutov's message of "Mon, 15 Dec 2014 19:34:50 +0200") Message-ID: <86mw6nkc6n.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) Arthur, do you experience this problem? What's your opinion on the fix? (http://debbugs.gnu.org/19390) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 08:26:19 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 13:26:19 +0000 Received: from localhost ([127.0.0.1]:47573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0s8o-0007np-QV for submit@debbugs.gnu.org; Tue, 16 Dec 2014 08:26:19 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:56942) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0s8m-0007ne-68 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 08:26:16 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so22857810obc.4 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 05:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=AZ0lJl6w9eGdgqyVsohfsA+NKH9D0f0qg/CPkb/Plxw=; b=Gu6It1zZwwC61qwC1rG4i6kDbn4caSlh2SHZxV3EqW9XFqggW55unChTN36OMIkfkF JuYbszAxmc/HGG/LbqMTP6K76DH5iDGWLN3DPSsLQzYJUszTrgrhcp+Mrg0AcEmpE3qu 1l9YiIrjfpkoAe0ngC+r15py9EkahBvFhODg3IXmbvzrGgeRM3f53YABdkwA38S9yU3+ OQG9EVAK38QxHHJxhr92wMlAAxUarv50r3ZGl2GE40aGPPxsWOghPbOviJLrGa+2xvRd f5fgUx4yMGqCahSWpJjy39O9Oh2AyLo56I+9ms3OcAm8dZxrbZWK7mnqcf5KiCI+riQ2 mwjg== MIME-Version: 1.0 X-Received: by 10.182.58.102 with SMTP id p6mr14057702obq.84.1418736375674; Tue, 16 Dec 2014 05:26:15 -0800 (PST) Received: by 10.76.154.106 with HTTP; Tue, 16 Dec 2014 05:26:15 -0800 (PST) In-Reply-To: <86mw6nkc6n.fsf@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> Date: Tue, 16 Dec 2014 11:26:15 -0200 X-Google-Sender-Auth: g4v1-ci7_6ryH4o0P7ghfT6fViE Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) I didn't notice anything as aggravating as the report, but I agree my latest patch is a performance concern. The proposed patch looks good, just a couple of notes: 1. I'd use RELOAD for the name of the optional argument. 2. Since this function now takes a second (somewhat non-trivial argument), we should add a docstring to it: "Activate package given by PKG-DESC, even if it was already active. If RELOAD is non-nil, also `load' any files inside the package which correspond to previously loaded files (those returned by `package--list-loaded-files'). This is called internally by `package-activate'." From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 08:42:13 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 13:42:13 +0000 Received: from localhost ([127.0.0.1]:47582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0sOD-0008Dk-AA for submit@debbugs.gnu.org; Tue, 16 Dec 2014 08:42:13 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:43499) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0sOA-0008Da-8n for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 08:42:10 -0500 Received: by mail-oi0-f52.google.com with SMTP id h136so9497857oig.39 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 05:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=nPuIAi22gn9zCoeZlhTEb1IVWIwAO7Y8n/4fBn2EQM4=; b=BkJSttv552CQKwmMLrXCY1uKBDbCR3h2SGjF6WTUzPT7jzZzEoDN/eRQppkBVx4wpG mzjsjVoZcTupRYncWrBhCfcbAkMXL8Ln355MRP5aqGmvMDgh0PQm9fETlptz/LWpLN8J zeZkUIV6qohm5s/BY48/LiR4tNLnUIvVawL8nt04e6ZLSEfHr8rTOCeqHiZNK1QFJc5B kjVaRzywFu7wYHUJH/N+ZkFWOwzRIbjjoLrMFPlDZ3ST+lU2zq8GRC7l0r9rFbfXyYrf X8ooHBnHlPyCm7mf1QIUBO6yfeDOCUa9/9bUC4lFt6JWf7MXdTjfChpBvjraCE3pldr4 dAgw== MIME-Version: 1.0 X-Received: by 10.182.102.161 with SMTP id fp1mr22543054obb.29.1418737329593; Tue, 16 Dec 2014 05:42:09 -0800 (PST) Received: by 10.76.154.106 with HTTP; Tue, 16 Dec 2014 05:42:09 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> Date: Tue, 16 Dec 2014 11:42:09 -0200 X-Google-Sender-Auth: dFRhMey3oAXwsB3iJ9Qi1nFhgEU Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) As for low-hanging fruits in `package--list-loaded-files', there are two I can think of. 1. If `load-history' stored `file-truename's (relative to "/"), instead of just absolute file names, then that would avoid a lot of calls to `file-truename'. This, I suspect, is the bigger performance issue. 2. Creating the `history' variable as below is a problem. (mapcar (lambda (x) (file-name-sans-extension (file-truename (car x)))) load-history) This lambda is called a lot more times than necessary, because most entries in load-history are useless here. But we need to do this to be able to reliably compare file names. Ideally, there would be another variable, like `load-history-truename', which is modified in parellel with `load-history' and *only* stores the truename of files listed in `load-history' (no need to store all that extra information). Then we could just use this variable unmodified. Implementing 2. would also fix 1. 2014-12-16 11:26 GMT-02:00 Artur Malabarba : > I didn't notice anything as aggravating as the report, but I agree my > latest patch is a performance concern. > > The proposed patch looks good, just a couple of notes: > > 1. I'd use RELOAD for the name of the optional argument. > 2. Since this function now takes a second (somewhat non-trivial > argument), we should add a docstring to it: > > "Activate package given by PKG-DESC, even if it was already active. > If RELOAD is non-nil, also `load' any files inside the package which > correspond to previously loaded files (those returned by > `package--list-loaded-files'). > > This is called internally by `package-activate'." From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 09:31:36 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 14:31:36 +0000 Received: from localhost ([127.0.0.1]:47638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0t9z-0002L9-UE for submit@debbugs.gnu.org; Tue, 16 Dec 2014 09:31:36 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:41456) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0t9x-0002L0-Ih for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 09:31:33 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so12641316wiw.15 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 06:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LYtG2Y5CShatNxa7RreBEm0B6rmPySogmBfKcGIfbPM=; b=L0KUreeN2YoIfCq7sMdKtLrl87izVuSCVbnsY76ZPJ4LUbNbDBNK7wBEz1hC6M0qj2 j835SUQhmAaQuyzdUVAKctpKksfcp8e/U/3bkF/Hxv+mCFi+PEZib85dSz6KQ+yfRReI DB/rGlhvWsplv7YmpvdT1+pMBKQcIjwXSj0WiNFxVO8+4UeKqPBBXT4/n1SrmBAUc1Pj Hq94SgP5Xr3l/asdqewCaCMR+syVYLbQ2OhkSvqxyTZkfG9vTG2AY5KfvntsGhDAbDTG p1nHbtHQlFdERxQzsmhLtTUC454qkFbjU/UEtkonDtCOB+rPCZi8BcRksppxpV9VnjYW aIIg== X-Received: by 10.180.91.37 with SMTP id cb5mr5342805wib.1.1418740291485; Tue, 16 Dec 2014 06:31:31 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id s9sm2344084wiz.12.2014.12.16.06.31.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 06:31:30 -0800 (PST) Message-ID: <54904241.8010000@yandex.ru> Date: Tue, 16 Dec 2014 16:31:29 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.6 (/) On 12/16/2014, Artur Malabarba wrote: > I didn't notice anything as aggravating as the report, but I agree my > latest patch is a performance concern. Do you maybe have fewer packages installed? > avoid a lot of > calls to `file-truename'. This, I suspect, is the bigger performance > issue. Any particular reason you're using `file-truename', instead of `expand-file-name'? Replacing the former with the latter already gives ~twofold performance improvement. > 2. Creating the `history' variable as below is a problem. > > (mapcar (lambda (x) (file-name-sans-extension > (file-truename (car x)))) > load-history) With the above change, this piece of code is relatively fast. For instance, (package--list-loaded-files default-directory) in the Helm directory takes 140 ms here, whereas (mapcar (lambda (x) (file-name-sans-extension (expand-file-name (car x)))) load-history) only takes ~10 ms. Still not fast enough not to need the other patch, of course. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 11:53:48 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 16:53:48 +0000 Received: from localhost ([127.0.0.1]:48039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0vNc-0005w0-CX for submit@debbugs.gnu.org; Tue, 16 Dec 2014 11:53:48 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:43797) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0vNa-0005vr-9b for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 11:53:46 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so12916322wiw.14 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 08:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=gK47QcgPP/Wp2FVfnubE/L5gDLNXmHmit19/AIMHOLs=; b=pB81trroNhlwEmTc6ZQfvDVrhJiTYkigDXdBZFeblXi0aCWIHYVCna2kJnaEjQ9NGK H8H+pvrxRy/KsP3XlPydqgQvbbzh0C9y1DmwArF9CakcNYELoVqu2lkE55DpvnOkdtgd bJNIYv4/sN4LXxnZWKj1QHuLXXMIVrthjTJhBZubFXXaFDdiYTzNo/XEClOrIaSINGhp zQN3oScChBf4CwKSxvL3AmRvxMZOLjWOy9OMZtfKcaojIdo+ZtjGOw5h0mCUSnIhlOVh I1YrT0ofX0+URWU+lzRRcnOzzwC/3XEm15XnIBmKJLPb1G3qKOoDRnlnstqX0IkkccE6 tnbQ== X-Received: by 10.180.81.7 with SMTP id v7mr6398755wix.74.1418748825464; Tue, 16 Dec 2014 08:53:45 -0800 (PST) Received: from axl (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id ej10sm17606623wib.1.2014.12.16.08.53.43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 08:53:44 -0800 (PST) From: Dmitry Gutov To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> Date: Tue, 16 Dec 2014 18:53:42 +0200 In-Reply-To: (Artur Malabarba's message of "Tue, 16 Dec 2014 11:42:09 -0200") Message-ID: <86y4q7r0x5.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) That aside, it's too bad not the whole of discussion leading to this implementation is public. Have the following alternative implementation options been considered? Since we only actually want to reload when upgrading, or reinstalling packages, maybe some key logic can move into `package-delete'. For instance: 1. Instead of scanning through the whole load-history when activating a package, we could have a list of paths that belonged to packages that we uninstalled during the current session. It would be collected in `package-delete', and it would certainly be empty at startup. 2. Instead of saving paths, remove elements from the `features' list when a package is deleted. Then when a dependency of this package is installed (or even autoloaded [0]), it would load the new files, because they're not in features. [0] IIUC, the current approach doesn't cover this situation. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 16:35:43 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 21:35:43 +0000 Received: from localhost ([127.0.0.1]:48203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0zmP-0000Ek-LD for submit@debbugs.gnu.org; Tue, 16 Dec 2014 16:35:43 -0500 Received: from mail-ob0-f182.google.com ([209.85.214.182]:55096) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y0zmN-0000Ec-Ih for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 16:35:40 -0500 Received: by mail-ob0-f182.google.com with SMTP id wo20so670320obc.13 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 13:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Rqkc1jqdFPFNnNmsd60Um+tD8ZT+NQDPnUqxIZiS5rA=; b=MQxztcZEUbrlpDt/+qKJQbVb42gbtaTMjCnavBljBzN0wjAtoeEZLdCFLoPpKspgu8 M8+pH2xJs71/nUnfr3aRHR9De/rEW+zQqVq0Sk13pJhwjqkkmUYA1Kdr6Xv+eOLT1KEJ jGLFuGQ5nhS/UTjrYUIyapcxZRI9nkjMBRL1dX7l73eoMNNknD4/XRkd0SAZ2oHg1+PO vU6IPOioYkL9xCGWPh6TuuxxD+1skW9M9EiqbQtlnJrTFVZcHKWbxWpo+gZ5N/JTgigM KG00EKcQPDcpkO/vh8P4rP5eqVm2WBzXWRW80Amvz5zGKpXXxe+FWASAVQjm/K8jgGNP 9m6w== MIME-Version: 1.0 X-Received: by 10.182.210.232 with SMTP id mx8mr24100830obc.46.1418765738811; Tue, 16 Dec 2014 13:35:38 -0800 (PST) Received: by 10.76.154.106 with HTTP; Tue, 16 Dec 2014 13:35:38 -0800 (PST) In-Reply-To: <54904241.8010000@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> Date: Tue, 16 Dec 2014 19:35:38 -0200 X-Google-Sender-Auth: fSsdqvdnJXv1K-VZ4iULyB_RPRc Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2014-12-16 12:31 GMT-02:00 Dmitry Gutov > On 12/16/2014, Artur Malabarba wrote: > >> I didn't notice anything as aggravating as the report, but I agree my >> latest patch is a performance concern. > > Do you maybe have fewer packages installed? Perhaps. But the reason is beyond the point, :-) I agree this patch needs performance improvements. > Any particular reason you're using file-truename', instead of >expand-file-name'? Replacing the former with the latter already gives > ~twofold performance improvement. Yes, I originally used `expand-file-name', but `package--list-loaded-files' would miss some files if there was a symlink in the path. (I specifically observed this, it's not just theory). The problem is that a file returned by `find-libary' could be the same as another file contained in `load-history' but have a different name (because of symlinks). >> 2. Creating the `history' variable as below is a problem. >> >> (mapcar (lambda (x) (file-name-sans-extension >> (file-truename (car x)))) >> load-history) > > > With the above change, this piece of code is relatively fast. > > For instance, (package--list-loaded-files default-directory) in the Helm > directory takes 140 ms here, whereas > > (mapcar (lambda (x) (file-name-sans-extension > (expand-file-name (car x)))) > load-history) > > only takes ~10 ms. Still not fast enough not to need the other patch, of > course. Yes, I agree `file-truename' is slow. The foolproof way would be to have a variable that stores the `file-truename's, so we wouldn't have to calculate them. Using `expand-file-name' is a valid way to improve performance here, but it won't *always* reload the files for all users. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 17:00:12 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 22:00:12 +0000 Received: from localhost ([127.0.0.1]:48211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y10A7-0000tU-3I for submit@debbugs.gnu.org; Tue, 16 Dec 2014 17:00:11 -0500 Received: from mail-ob0-f179.google.com ([209.85.214.179]:51612) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y109x-0000sI-O9 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 17:00:08 -0500 Received: by mail-ob0-f179.google.com with SMTP id va2so793795obc.10 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 14:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=BDlqXmR9kbHaoWNffnpP+bFSycZK2FZ9v03USVMuAPc=; b=SSXl1Gr/0kuQyk1P+K2qC9Zb0GJsa5WrLucGHThwKUrGebtOYWaFo8vpn3MDujISMp sDM2O5oLXukaAMoOOhCygfJsP+Fc0Cw6ZiOpHpJ8PXsABcA1T7Y87Vjk5+q1GLEkzsn7 DspotS22iSWLB41xmCj/GTE/ul8b5QzginmtXzP4ed9zD0y9plEqHePZXX4ePZmapVIT bn0RpFACOyjlAOXVxnmJL7cjBH4x/UpWyjlhZbbVY/fdqWzcmNuXIzTNRbx62IKi+sD5 Rg4VMoecNT16VPlUh2/LkZEzgp7bulli/XdkZbeuRxYnM/arW9HPTi60JkFti7+QRKe6 PgWA== MIME-Version: 1.0 X-Received: by 10.60.115.97 with SMTP id jn1mr23704685oeb.17.1418767200916; Tue, 16 Dec 2014 14:00:00 -0800 (PST) Received: by 10.76.154.106 with HTTP; Tue, 16 Dec 2014 14:00:00 -0800 (PST) In-Reply-To: <86y4q7r0x5.fsf@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <86y4q7r0x5.fsf@yandex.ru> Date: Tue, 16 Dec 2014 20:00:00 -0200 X-Google-Sender-Auth: jldA0efTDMF0SposgXlyqIccdSs Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2014-12-16 14:53 GMT-02:00 Dmitry Gutov : > That aside, it's too bad not the whole of discussion leading to this > implementation is public. The discussion started here: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00567.html Oddly enough, I can't find the end of it. =/ I'll be glad to explain any of the considerations. > Have the following alternative implementation options been considered? > Since we only actually want to reload when upgrading, or reinstalling > packages, maybe some key logic can move into `package-delete'. Besides the points I mention below, there's one edge case where this could be a problem. Built-in packages can be upgraded too, and they can't be deleted. > For instance: > > 1. Instead of scanning through the whole load-history when activating a > package, we could have a list of paths that belonged to packages that we > uninstalled during the current session. It would be collected in > `package-delete', and it would certainly be empty at startup. The way it's done right now, package-delete is called after package-install during upgrades, so that would need to change in order for this implementation to work. I would rather ask on the devel-list before making a change like this (I don't know if there's a particular reason behind the original choice), but other than that, that sounds like a good solution. > 2. Instead of saving paths, remove elements from the `features' list > when a package is deleted. Then when a dependency of this package is > installed (or even autoloaded [0]), it would load the new files, because > they're not in features. Again, this relies on us deleting before installing, but I prefer you first idea. Removing elements from `features' could have unintended consequences. We're pretending the package isn't loaded even though it is (all its functions and variables are bound). > > [0] IIUC, the current approach doesn't cover this situation. The current approach does cover autoloads. The autoloads file of a package is always `load'ed when a package is activated (which always happens when a package is installed, even after an upgrade). Calling `load' on a file which contains a new definition for an already defined autoload (which is what happens on upgrades) redefines the autoload to the new definition. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:16:50 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:16:50 +0000 Received: from localhost ([127.0.0.1]:48228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11MI-00049H-GD for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:16:50 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:2956) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11MG-00049A-W2 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:16:49 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102727620" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Dec 2014 18:16:48 -0500 Received: by pastel.home (Postfix, from userid 20848) id 4FDEB12E5; Tue, 16 Dec 2014 18:16:48 -0500 (EST) From: Stefan Monnier To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> Date: Tue, 16 Dec 2014 18:16:48 -0500 In-Reply-To: (Artur Malabarba's message of "Tue, 16 Dec 2014 19:35:38 -0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Yes, I originally used `expand-file-name', but > `package--list-loaded-files' would miss some files if there was a > symlink in the path. (I specifically observed this, it's not just > theory). Do you remember the scenario where you saw that? Normally, the load-history contains the file names using the directory names that appear in load-path, so while they're not "canonical", as long as we stick to using file name relative to directories in `load-path' it seems that the cases where two files are really the same and we don't detect it should be rather rare. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:19:17 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:19:17 +0000 Received: from localhost ([127.0.0.1]:48232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11Oe-0004DP-Un for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:19:17 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:53367) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11Od-0004DI-S4 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:19:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpAtQgeESAWLAYxVBZdUgXiEGSGBNoFBAQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpAtQgeESAWLAYxVBZdUgXiEGSGBNoFBAQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102727901" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Dec 2014 18:19:15 -0500 Received: by pastel.home (Postfix, from userid 20848) id E348412E5; Tue, 16 Dec 2014 18:19:14 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <86y4q7r0x5.fsf@yandex.ru> Date: Tue, 16 Dec 2014 18:19:14 -0500 In-Reply-To: <86y4q7r0x5.fsf@yandex.ru> (Dmitry Gutov's message of "Tue, 16 Dec 2014 18:53:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Artur Malabarba X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Since we only actually want to reload when upgrading, or reinstalling > packages, maybe some key logic can move into `package-delete'. package-delete sounds clearly wrong, since we may very well install a new version without removing the old version. > 2. Instead of saving paths, remove elements from the `features' list > when a package is deleted. Then when a dependency of this package is > installed (or even autoloaded [0]), it would load the new files, because > they're not in features. Eagerly reloading files is much more effective than just removing them from `features'. E.g. in the case of autoloaded functions. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:27:15 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:27:15 +0000 Received: from localhost ([127.0.0.1]:48240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11WN-0004Pr-Ae for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:27:15 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:57978) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11WK-0004Pi-UD for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:27:13 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so13958480wiw.2 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 15:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+aQs94Nu/X/XBArwh75Fj+XoNfdTd1Vv2zzvGeJckmo=; b=I3rpmlMcIbPRVsk2YZuMnpBtfzukLoCIp1uYj22f6EHSKRVj3i1LX9NkbbcMyaplAt 4ivF9JAEYpnOEZxbHTnBQ4Eqt6ZjjwRv8zy+4i19/pwdi6sEZ8bi2kTQICtyK9GdlFmY fR2tP+PrFtF4hARfaESL5AWWJyeSdp9qTX/UrPJyYxJQHdQjKRHrREr3NBSzH1Frl+pW Rlyae+b6DDAa9Y64XoGKr+jRMv3B5alruEhiXYwWC8eCigwQZK5kW1wTmIKdd10r54d9 CJB6vCK0kiwNXO2/cZ/WnH5soTprD0wmgYQYdBoB+GWT8auPng1Sdqg8YsuXx7PaKDZv OXrg== X-Received: by 10.180.108.143 with SMTP id hk15mr9119325wib.6.1418772432338; Tue, 16 Dec 2014 15:27:12 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id w10sm2873963wje.10.2014.12.16.15.27.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 15:27:11 -0800 (PST) Message-ID: <5490BFCD.5050505@yandex.ru> Date: Wed, 17 Dec 2014 01:27:09 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stefan Monnier , Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/17/2014 01:16 AM, Stefan Monnier wrote: > Do you remember the scenario where you saw that? Normally, the > load-history contains the file names using the directory names that > appear in load-path, so while they're not "canonical", Actually, it seems to me that load-history does contain canonical names. At least, when the file being loaded is a symlink, the resulting record in load-history contains the path of the file it points to. Same for a real file in a symlinked dir. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:41:05 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:41:05 +0000 Received: from localhost ([127.0.0.1]:48245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11jk-0004n5-PS for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:41:05 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:49763) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11jh-0004mX-8Q for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:41:01 -0500 Received: by mail-wi0-f171.google.com with SMTP id bs8so13905736wib.16 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 15:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Qrpr3L7BffOZAGgb47qfqhh/nQUu/3Dy0S55znadEtA=; b=MTwd/lvzfn6cRiEcISI342DRP/vdaE3ErjwMlK7pFKnsixSNjlf8BijVt9Ge4X22oD l0rd+HuHSc9Huyt7qtOD9q58fYDX5Al1ndkMFLN2LlldUrjA5wNTXBX/IT4wXtqbG534 3Qjjz7XKQ7ZFNpC1Yqssskmciocb14K2GwMjOokmfkD8wMzFKis+Mqwm7uPZO9vaNJds gt5/2wAmzAUj4iKJUxji+Qtfwm9o9xgGBeCW1dAm3Ja47ZQ73Hmak79ad8I8oY7VjEAf 2TFxNeZ3mDPaX2BOH6o/SXZsdnz26yirxFoxc480fKqHBDl/AFkoXlvzWrNpmmEi7y3F 62Ow== X-Received: by 10.194.88.228 with SMTP id bj4mr27674659wjb.18.1418773260612; Tue, 16 Dec 2014 15:41:00 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id js5sm18734327wid.11.2014.12.16.15.40.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 15:41:00 -0800 (PST) Message-ID: <5490C30A.6070803@yandex.ru> Date: Wed, 17 Dec 2014 01:40:58 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <86y4q7r0x5.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Artur Malabarba X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/17/2014 01:19 AM, Stefan Monnier wrote: > package-delete sounds clearly wrong, since we may very well install > a new version without removing the old version. Oh, right. `package-install', then? It can check if another version of the given package is already installed, and if so that do that thing. > Eagerly reloading files is much more effective than just removing them > from `features'. E.g. in the case of autoloaded functions. How about calling `unload-feature', too? It sounds nice on paper, and this might be a good (first?) use for it. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:55:26 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:55:26 +0000 Received: from localhost ([127.0.0.1]:48256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11xd-000586-Tr for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:55:26 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:12982) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11xb-00057x-JQ for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:55:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDiYSFBgNJIhKCdZZAQEBAQEBBAEBAQEekG8HhEgFiwGMVQWXVIF4hBkhgncBAQE X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDiYSFBgNJIhKCdZZAQEBAQEBBAEBAQEekG8HhEgFiwGMVQWXVIF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102731843" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Dec 2014 18:55:20 -0500 Received: by pastel.home (Postfix, from userid 20848) id A7EE312E5; Tue, 16 Dec 2014 18:55:20 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> Date: Tue, 16 Dec 2014 18:55:20 -0500 In-Reply-To: <5490BFCD.5050505@yandex.ru> (Dmitry Gutov's message of "Wed, 17 Dec 2014 01:27:09 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Artur Malabarba X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> Do you remember the scenario where you saw that? Normally, the >> load-history contains the file names using the directory names that >> appear in load-path, so while they're not "canonical", > Actually, it seems to me that load-history does contain canonical names. > At least, when the file being loaded is a symlink, the resulting record in > load-history contains the path of the file it points to. Same for a real > file in a symlinked dir. Hmm... OK, then that would explain why he needed to use file-truename. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 18:57:00 2014 Received: (at 19390) by debbugs.gnu.org; 16 Dec 2014 23:57:00 +0000 Received: from localhost ([127.0.0.1]:48260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11z9-0005AR-Pk for submit@debbugs.gnu.org; Tue, 16 Dec 2014 18:56:59 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:11404) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y11z7-0005AJ-S1 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 18:56:58 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102731999" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Dec 2014 18:56:57 -0500 Received: by pastel.home (Postfix, from userid 20848) id 22D2612E5; Tue, 16 Dec 2014 18:56:57 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <86y4q7r0x5.fsf@yandex.ru> <5490C30A.6070803@yandex.ru> Date: Tue, 16 Dec 2014 18:56:57 -0500 In-Reply-To: <5490C30A.6070803@yandex.ru> (Dmitry Gutov's message of "Wed, 17 Dec 2014 01:40:58 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Artur Malabarba X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > How about calling `unload-feature', too? It sounds nice on paper, and this > might be a good (first?) use for it. Yes, it sounds nice on paper, but in my experience unload-feature is much too unreliable to foist it upon users like that. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 19:40:11 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 00:40:11 +0000 Received: from localhost ([127.0.0.1]:48269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y12ew-0006Ea-M1 for submit@debbugs.gnu.org; Tue, 16 Dec 2014 19:40:11 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:35926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y12et-0006EP-W6 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 19:40:08 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so1389385obc.4 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 16:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=KLYl81k20W+9TErQLVU0lHPSW8R1Us2ZWaEir2DHnUc=; b=XzPHu610wP0W07mLX0VkipKeMdG7JfhqIYTn162XnZPWPM0GY7mKQgIiZK5JWrGrm6 MhC1lL3ogpxkUjPsL+88GgN+eddaqCKR9KKv3T6AXVDpGI6wh5eNPJF2C9ZEYinAt57Y VXe29UiadGHzAjrLrotf7GOYUIOORlWInTRO3hDfcwQGihn7lTjVTTiRE4KZBTZF3Q46 VRCz9Sey+pLy+S2pfP+AJU168HsyknYonvG6M5zKg9JsgbGiXvxfoeC7FdSZtNRJfRnA advNeb/2KfGG5JtXmyxyoNup+x18IF7DBLqyKOWPoPQOtWZDHp4ph0JUhYLFiUKdHiEL aKLA== MIME-Version: 1.0 X-Received: by 10.182.102.161 with SMTP id fp1mr24340721obb.29.1418776807292; Tue, 16 Dec 2014 16:40:07 -0800 (PST) Received: by 10.76.26.162 with HTTP; Tue, 16 Dec 2014 16:40:07 -0800 (PST) Received: by 10.76.26.162 with HTTP; Tue, 16 Dec 2014 16:40:07 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> Date: Tue, 16 Dec 2014 22:40:07 -0200 X-Google-Sender-Auth: ykzLav3kLX37irefwMW2OSP9uhg Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Stefan Monnier Content-Type: multipart/alternative; boundary=089e0149c1ce9d4489050a5eb7fb X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --089e0149c1ce9d4489050a5eb7fb Content-Type: text/plain; charset=UTF-8 On 16 Dec 2014 21:55, "Stefan Monnier" wrote: > > >> Do you remember the scenario where you saw that? Normally, the > >> load-history contains the file names using the directory names that > >> appear in load-path, so while they're not "canonical", > > Actually, it seems to me that load-history does contain canonical names. > > At least, when the file being loaded is a symlink, the resulting record in > > load-history contains the path of the file it points to. Same for a real > > file in a symlinked dir. > > Hmm... OK, then that would explain why he needed to use file-truename. Actually, this means I may have overused file-truename. If load-history already stores canonical names, then we only need to call truename on the return value of find library, not on the elements of load-history. If nobody else checks, I'll check tomorrow when I get a chance. --089e0149c1ce9d4489050a5eb7fb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 16 Dec 2014 21:55, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote= :
>
> >> Do you remember the scenario where you saw that?=C2=A0 Normal= ly, the
> >> load-history contains the file names using the directory name= s that
> >> appear in load-path, so while they're not "canonical= ",
> > Actually, it seems to me that load-history does contain canonical= names.
> > At least, when the file being loaded is a symlink, the resulting = record in
> > load-history contains the path of the file it points to.=C2=A0 Sa= me for a real
> > file in a symlinked dir.
>
> Hmm... OK, then that would explain why he needed to use file-truename.=

Actually, this means I may have overused file-truename. If l= oad-history already stores canonical names, then we only need to call truen= ame on the return value of find library, not on the elements of load-histor= y.

If nobody else checks, I'll check tomorrow when I get a = chance.

--089e0149c1ce9d4489050a5eb7fb-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 20:05:44 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 01:05:44 +0000 Received: from localhost ([127.0.0.1]:48277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y133f-0006sd-Er for submit@debbugs.gnu.org; Tue, 16 Dec 2014 20:05:43 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:49109) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y133d-0006sV-6c for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 20:05:42 -0500 Received: by mail-wg0-f45.google.com with SMTP id b13so18844922wgh.4 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 17:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=nY1KxALGwAbnbFLoyVUEg8gE7FA4Uq47GE7NN3FSgfU=; b=BHKYHXsxbdey2JyRiVanhQVcjIpHK4U+njP2BUPoC5TikN12mBTPwqA1dHMubVyJtT 6VgnE60sDCKBhLurJwRu9bKOvX1GmwB8aGlOHbmYD/ZdMUt3HmMaPipi8YMbUZH3Q1Kv x0Lpb06YTU9lb8ri11LdsLB+YnpIati1fiVCF2bLXw+yrsy+3rmta8Cpr+uB+hvxBpBI oTEzCKB4oKmy7oEiB/51bEzgA/GW4MrlkYg2mOVfDSrUC20XgdYBYHWC4P9ZbPPfGmpm BiaPW2jY8Xl4SlH+kfdNbhJB3Bok6i9mzrkPbbCVlX7yBVvkKXYjxjkKvh9aQwyAyc72 ArqA== X-Received: by 10.194.178.231 with SMTP id db7mr65274968wjc.112.1418778340520; Tue, 16 Dec 2014 17:05:40 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id iz19sm18916318wic.8.2014.12.16.17.05.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 17:05:40 -0800 (PST) Message-ID: <5490D6E1.7080907@yandex.ru> Date: Wed, 17 Dec 2014 03:05:37 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <86y4q7r0x5.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/17/2014 12:00 AM, Artur Malabarba wrote: > The discussion started here: > http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00567.html > Oddly enough, I can't find the end of it. =/ Thanks, the part available there already explained the more complex part (why sorting). > The current approach does cover autoloads. The autoloads file of a > package is always `load'ed when a package is activated (which always > happens when a package is installed, even after an upgrade). Calling > `load' on a file which contains a new definition for an already > defined autoload (which is what happens on upgrades) redefines the > autoload to the new definition. I see. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 20:17:38 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 01:17:38 +0000 Received: from localhost ([127.0.0.1]:48281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y13FB-0007AP-Ta for submit@debbugs.gnu.org; Tue, 16 Dec 2014 20:17:38 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:53071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y13FA-0007AH-1Y for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 20:17:36 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so14344888wid.11 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 17:17:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5NUGlymM9clSSJ4YxOytRAbKqC9a7fsKKs7MobmX2gg=; b=cgDfLx14snsfmdOhbHVm8yQQx3TCWM3JSI1w3eDaZU2sitIO2CiFbdSOvCoEFPlOlY bPRhtAd3edsdQS3dGDty1if+gYBCH71x6l64uzt8rKuK5+iFL78UItowGs5mtpPXQjx4 vSdE+zqwjI6wtqJKR7BPMG4kfJRHO+hI+BmVlGVn/O3xRiQWKK9bwy+78FKCMF3OZYDa s0WFC5/kbXOjbMksffvbu6TobmnvjP8LvHhJw1qcVslqj9w9cSqmcVn0kLC/HRlui+9p xZc2GJ/lWlwVbHG4ygmuLfv/87VCHxMaUOql93q9mXPO9YDCb7Ey5vFYEROumHo/X4AH xGdg== X-Received: by 10.194.86.165 with SMTP id q5mr67555051wjz.10.1418779054423; Tue, 16 Dec 2014 17:17:34 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id gl5sm18871663wib.0.2014.12.16.17.17.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 17:17:34 -0800 (PST) Message-ID: <5490D9AB.5090402@yandex.ru> Date: Wed, 17 Dec 2014 03:17:31 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com, Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/17/2014 02:40 AM, Artur Malabarba wrote: > Actually, this means I may have overused file-truename. If load-history > already stores canonical names, then we only need to call truename on > the return value of find library, not on the elements of load-history. Look like. > If nobody else checks, I'll check tomorrow when I get a chance. I'll commit the fix soon (it gives a nice performance boost already), but please go ahead and double-check it tomorrow. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 16 21:41:57 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 02:41:57 +0000 Received: from localhost ([127.0.0.1]:48294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y14Ym-0000rC-8U for submit@debbugs.gnu.org; Tue, 16 Dec 2014 21:41:56 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:46521) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y14Yj-0000r2-G8 for 19390@debbugs.gnu.org; Tue, 16 Dec 2014 21:41:54 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so2860171wgh.29 for <19390@debbugs.gnu.org>; Tue, 16 Dec 2014 18:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=BjlF4dE80AbvhX+Wi9Qe8BveFFtm7Ykfp+4ubbEf0Og=; b=PByMWVwzpZhd+iVWKX0NcPWF5YDx7dROUdqTQ42z75UxoZQVhKRJ1ORki9cU7jIuqr JqW6hGzFCAdS6ScyJU/cmpXIKPSLhwwJVV7aQ578tOJTcF9nUtBJ/+9mI8Jyt7RVv8nQ DYeFzT9Stx6h5LkGDeu9JxiF/e2aQ8KhktP8ARSQqhJDXHU0yxVOUsLtySp/LOA5sNVx tQ/GTFISGIcRpfp9fE+YOw8qSxW5n8veax0F74Bs0qLwXjBdo3Z8FXRplYOb84ikNao0 P/Ja60wedEsuktC3StEKvuy+1Khyi6pK7tHWhDj2JnMpje9Lu5X2dn8Frq6NHO5nW7Cw m/Tw== X-Received: by 10.180.182.199 with SMTP id eg7mr9733976wic.17.1418784112625; Tue, 16 Dec 2014 18:41:52 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id j2sm3260147wjs.28.2014.12.16.18.41.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 18:41:52 -0800 (PST) Message-ID: <5490ED6D.5080808@yandex.ru> Date: Wed, 17 Dec 2014 04:41:49 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com, Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Speaking of non-radical optimizations, this takes the packages activation time of 2.1 s (after the last small patch) down to 300 ms. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 60beebd..30b5fb2 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -527,7 +527,7 @@ Return the max version (as a string) if the package is held at a lower version." (let* ((old-lp load-path) (autoloads-file (expand-file-name (format "%s-autoloads" name) pkg-dir)) - (loaded-files-list (package--list-loaded-files pkg-dir))) + (loaded-files-list (package--list-loaded-files name pkg-dir))) (with-demoted-errors (format "Error loading %s: %%s" name) (load autoloads-file nil t)) (when (and (eq old-lp load-path) @@ -555,36 +555,36 @@ Return the max version (as a string) if the package is held at a lower version." ;; Don't return nil. t)) -(defun package--list-loaded-files (dir) +(defun package--list-loaded-files (name dir) "Recursively list all files in DIR which correspond to loaded features. Returns the `file-name-sans-extension' of each file, relative to DIR, sorted by most recently loaded last." - (let* ((history (mapcar (lambda (x) (file-name-sans-extension (car x))) - load-history)) - (dir (file-truename dir)) - ;; List all files that have already been loaded. - (list-of-conflicts - (remove - nil - (mapcar - (lambda (x) (let* ((file (file-relative-name x dir)) - ;; Previously loaded file, if any. - (previous - (ignore-errors - (file-name-sans-extension - (file-truename (find-library-name file))))) - (pos (when previous (member previous history)))) - ;; Return (RELATIVE-FILENAME . HISTORY-POSITION) - (when pos - (cons (file-name-sans-extension file) (length pos))))) - (directory-files-recursively dir "\\`[^\\.].*\\.el\\'"))))) - ;; Turn the list of (FILENAME . POS) back into a list of features. Files in - ;; subdirectories are returned relative to DIR (so not actually features). - (let ((default-directory (file-name-as-directory dir))) - (mapcar (lambda (x) (file-truename (car x))) - (sort list-of-conflicts - ;; Sort the files by ascending HISTORY-POSITION. - (lambda (x y) (< (cdr x) (cdr y)))))))) + (let* ((old-dir-re (concat "\\`" + (regexp-quote (file-truename package-user-dir)) + "/" (regexp-quote (symbol-name name)))) + (filtered-history (cl-loop for entry in load-history + for file = (car entry) + when (string-match-p old-dir-re file) + collect (file-name-sans-extension file))) + (files (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")) + (files-re (concat "/" + (regexp-opt + (mapcar (lambda (x) + (file-name-sans-extension + (file-relative-name x dir))) + files)) + "\\'")) + list-of-conflicts) + ;; List all the matching files from the load history, in + ;; historical order. + (dolist (file filtered-history) + (when (string-match files-re file) + (cl-pushnew (substring (match-string 0 file) 1) + list-of-conflicts + :test #'equal))) + ;; Files in subdirectories are returned relative to DIR (so not + ;; actually features). + list-of-conflicts)) (defun package-built-in-p (package &optional min-version) "Return true if PACKAGE is built-in to Emacs. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 17 05:47:59 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 10:48:00 +0000 Received: from localhost ([127.0.0.1]:48472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1C99-0005x8-E1 for submit@debbugs.gnu.org; Wed, 17 Dec 2014 05:47:59 -0500 Received: from mail-ob0-f171.google.com ([209.85.214.171]:40627) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1C97-0005x1-TC for 19390@debbugs.gnu.org; Wed, 17 Dec 2014 05:47:58 -0500 Received: by mail-ob0-f171.google.com with SMTP id uz6so3099315obc.2 for <19390@debbugs.gnu.org>; Wed, 17 Dec 2014 02:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=g9QjyC1rA8fziTsQiTkb6EoAY6uRedr1IBHPD6NGHb4=; b=aP15BHSlVt8VFvHBG7tSigQbJ/k3L6fuzMFaQKbPk4ak8ZpdH6wSZ5jyariJPadigx idh408fGdZul+ms91c6Wt1d9Ye5K7D15oHA0fpeMOOfntQibIJIWN9C6XocdiCoqpZ2c f7qTALr1/jxsUbhxCDLryS8X6oXcteS5ni4xxiTRCG8ajDVyQ0aIlmWsJhXn8oYgcANG hmQY4CHnK9DCN5XLBmsECFS3OXlNUolX5Gmh2NAQCVE6blee7pNxXcPWpHZZolognh4E r5VnzUiexCJJQDy/YfweJ5zV1HbJ7gERbQzz0RogqkUNQlgiP3E2tEel0nt/qAvfKc9P 2rzA== MIME-Version: 1.0 X-Received: by 10.60.115.97 with SMTP id jn1mr25240489oeb.17.1418813277413; Wed, 17 Dec 2014 02:47:57 -0800 (PST) Received: by 10.76.26.162 with HTTP; Wed, 17 Dec 2014 02:47:57 -0800 (PST) Received: by 10.76.26.162 with HTTP; Wed, 17 Dec 2014 02:47:57 -0800 (PST) In-Reply-To: <5490ED6D.5080808@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> Date: Wed, 17 Dec 2014 08:47:57 -0200 X-Google-Sender-Auth: sG6_QFil4zIvmfLIPWXygf1LvhA Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: multipart/alternative; boundary=089e0115ed2e672998050a6735c7 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --089e0115ed2e672998050a6735c7 Content-Type: text/plain; charset=UTF-8 On 17 Dec 2014 00:41, "Dmitry Gutov" wrote: > + (let* ((old-dir-re (concat "\\`" > + (regexp-quote (file-truename package-user-dir)) > + "/" (regexp-quote (symbol-name name)))) > + (filtered-history (cl-loop for entry in load-history > + for file = (car entry) > + when (string-match-p old-dir-re file) > + collect (file-name-sans-extension file))) This will fail if the previously loaded version wasn't installed in the package-user-dir, which, again, is the case for built-in packages. This also includes manually installed packages, which we may or may not care about supporting. --089e0115ed2e672998050a6735c7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 17 Dec 2014 00:41, "Dmitry Gutov" <dgutov@yandex.ru> wrote:
> +=C2=A0 (let* ((old-dir-re (concat "\\`"
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(regexp-quote (file-truename package-use= r-dir))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"/" (regexp-quote (symbol-name= name))))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(filtered-history (cl-loop for entr= y in load-history
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for file =3D (car = entry)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 when (string-match= -p old-dir-re file)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 collect (file-name= -sans-extension file)))

This will fail if the previously loaded version wasn't i= nstalled in the package-user-dir,=C2=A0 which, again, is the case for built= -in packages. This also includes manually installed packages, which we may = or may not care about supporting.

--089e0115ed2e672998050a6735c7-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 17 09:33:50 2014 Received: (at 19390) by debbugs.gnu.org; 17 Dec 2014 14:33:50 +0000 Received: from localhost ([127.0.0.1]:48586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Ffh-0005vN-BN for submit@debbugs.gnu.org; Wed, 17 Dec 2014 09:33:49 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:63635) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Ffc-0005vC-Gv for 19390@debbugs.gnu.org; Wed, 17 Dec 2014 09:33:45 -0500 Received: by mail-oi0-f52.google.com with SMTP id h136so11099286oig.39 for <19390@debbugs.gnu.org>; Wed, 17 Dec 2014 06:33:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=CZctomU6R2ecBstkp7FNoOkKTQXM1BRd0j21t4ZLrGA=; b=qBJ4EnQjU+Snl0t7XVTsMhhawwJlW06QmOfxYM2BZ/Ly02ww9GnlN68T+gZBx9BYb6 iRdZMwwoFL5gmAnILFWONa7McmVppb5Id9laUHEV9a8nAJq6HiJccYIcOw65NoLWIy++ lp8DcXvZIU7jwZgfP3zhoLj3a2sV+BqZqLYH3Gh4+eU7bLmAmbDQHe7so9a2f+RRzzul 3gUas3Bp2G8wMUbY33ecSIgqR7aUA2CsMu5mKBgNpfTSYS13Cs1zOFl/PMQkfv8Pn45X M5FMD3M+ZlBJ3E+qG8VCdKd+UR/1k+O0wyrS3ej9luyHN5SzcAiQOH7fjDxKN2NG91Ey aqKQ== MIME-Version: 1.0 X-Received: by 10.60.129.135 with SMTP id nw7mr24976631oeb.4.1418826823766; Wed, 17 Dec 2014 06:33:43 -0800 (PST) Received: by 10.76.26.162 with HTTP; Wed, 17 Dec 2014 06:33:43 -0800 (PST) In-Reply-To: <5490D9AB.5090402@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490D9AB.5090402@yandex.ru> Date: Wed, 17 Dec 2014 12:33:43 -0200 X-Google-Sender-Auth: jP7C9vV46UrD1S5W6dykUX2KK4Q Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) FWIW, I just checked an indeed it seems load-history stores file-truenames. So that patch is all good. 2014-12-16 23:17 GMT-02:00 Dmitry Gutov : > On 12/17/2014 02:40 AM, Artur Malabarba wrote: > >> Actually, this means I may have overused file-truename. If load-history >> already stores canonical names, then we only need to call truename on >> the return value of find library, not on the elements of load-history. > > > Look like. > >> If nobody else checks, I'll check tomorrow when I get a chance. > > > I'll commit the fix soon (it gives a nice performance boost already), but > please go ahead and double-check it tomorrow. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 17 19:14:29 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 00:14:29 +0000 Received: from localhost ([127.0.0.1]:49352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Ojd-0002LR-AW for submit@debbugs.gnu.org; Wed, 17 Dec 2014 19:14:29 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:61977) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Oja-0002LH-It for 19390@debbugs.gnu.org; Wed, 17 Dec 2014 19:14:27 -0500 Received: by mail-wi0-f171.google.com with SMTP id bs8so38988wib.4 for <19390@debbugs.gnu.org>; Wed, 17 Dec 2014 16:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=gVK6TFdKwL+FT1ne+aR1FQPHMTypK2dQxX2LgGZ4G24=; b=AJ8DjpmxOl8ZSUMoSKNEn5q1/AG57H8lGKJANA0F1GPtR/j3MRPISeXdCIADlP6R9i EMzLh8yDDYWveIZSgGnDcJXjwJEisH+rJtLJj3v0eWdebpC/i/vEt290xivTyUnBCnaS nYU1/GNdGZO1nt/yUVaIonmscmIqRdVo+DZ4KJjTBnqTxqQ1LOMieDDHF+5b4/bc6b8r uzYBJdJ5zf2oWZuLVAYhcTvowLgg1S3n7XfvWM5L3bVgMwUJPDbkPiuTTN5AqUmrRDbL WI4hMbP/HuDLPDqAIuAOz0I1l7c2NjT8uklY9ND4qQiCxW7EfGSlu3ZBg1W181QJso/T /WgA== X-Received: by 10.180.93.37 with SMTP id cr5mr19273469wib.76.1418861665647; Wed, 17 Dec 2014 16:14:25 -0800 (PST) Received: from axl ([82.102.93.58]) by mx.google.com with ESMTPSA id dp8sm22725918wib.20.2014.12.17.16.14.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Dec 2014 16:14:25 -0800 (PST) From: Dmitry Gutov To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> Date: Thu, 18 Dec 2014 02:14:22 +0200 In-Reply-To: (Artur Malabarba's message of "Wed, 17 Dec 2014 08:47:57 -0200") Message-ID: <868ui5ervl.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Artur Malabarba writes: > This will fail if the previously loaded version wasn't installed in the > package-user-dir, which, again, is the case for built-in packages. This > also includes manually installed packages, which we may or may not care > about supporting. Good point, thanks. Here's the patch without the initial filtering part. Still an improvement over the current code (0.6s vs 2.1s on my machine). (And it drops the use of `file-name-sans-extension'). We could also check the `provide' value in each entry's alist, to make sure of the match, probably at no major cost. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 60beebd..90bb514 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -559,32 +559,26 @@ Return the max version (as a string) if the package is held at a lower version." "Recursively list all files in DIR which correspond to loaded features. Returns the `file-name-sans-extension' of each file, relative to DIR, sorted by most recently loaded last." - (let* ((history (mapcar (lambda (x) (file-name-sans-extension (car x))) - load-history)) - (dir (file-truename dir)) - ;; List all files that have already been loaded. - (list-of-conflicts - (remove - nil - (mapcar - (lambda (x) (let* ((file (file-relative-name x dir)) - ;; Previously loaded file, if any. - (previous - (ignore-errors - (file-name-sans-extension - (file-truename (find-library-name file))))) - (pos (when previous (member previous history)))) - ;; Return (RELATIVE-FILENAME . HISTORY-POSITION) - (when pos - (cons (file-name-sans-extension file) (length pos))))) - (directory-files-recursively dir "\\`[^\\.].*\\.el\\'"))))) - ;; Turn the list of (FILENAME . POS) back into a list of features. Files in - ;; subdirectories are returned relative to DIR (so not actually features). - (let ((default-directory (file-name-as-directory dir))) - (mapcar (lambda (x) (file-truename (car x))) - (sort list-of-conflicts - ;; Sort the files by ascending HISTORY-POSITION. - (lambda (x y) (< (cdr x) (cdr y)))))))) + (let* ((files (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")) + (files-re (concat "/" + (regexp-opt + (mapcar (lambda (x) + (file-relative-name x dir)) + files) + t) + "c?\\'")) + list-of-conflicts) + ;; List all the matching files from the load history, in + ;; historical order. + (dolist (entry load-history) + (let ((file (car entry))) + (when (string-match files-re file) + (cl-pushnew (substring (match-string 1 file) 0 -3) + list-of-conflicts + :test #'equal)))) + ;; Files in subdirectories are returned relative to DIR (so not + ;; actually features). + list-of-conflicts)) (defun package-built-in-p (package &optional min-version) "Return true if PACKAGE is built-in to Emacs. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 17 20:38:19 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 01:38:19 +0000 Received: from localhost ([127.0.0.1]:49382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Q2k-0004QP-Vc for submit@debbugs.gnu.org; Wed, 17 Dec 2014 20:38:19 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:13804) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1Q2h-0004QF-2g for 19390@debbugs.gnu.org; Wed, 17 Dec 2014 20:38:15 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102846369" Received: from 206-248-130-192.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Dec 2014 20:38:14 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 127D0660DC; Wed, 17 Dec 2014 20:38:14 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> Date: Wed, 17 Dec 2014 20:38:14 -0500 In-Reply-To: <868ui5ervl.fsf@yandex.ru> (Dmitry Gutov's message of "Thu, 18 Dec 2014 02:14:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Artur Malabarba X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Good point, thanks. Here's the patch without the initial filtering part. > Still an improvement over the current code (0.6s vs 2.1s on my machine). Just a side note: the most important optimization is to make sure that the activation of all the installed packages at startup time is done without going through this "reload previously loaded files". IIUC, this is the first optimization that was proposed in this thread, and is the main one to install (regardless of the others). Has it been installed? Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 17 21:11:26 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 02:11:26 +0000 Received: from localhost ([127.0.0.1]:49404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1QYn-0005am-Q7 for submit@debbugs.gnu.org; Wed, 17 Dec 2014 21:11:26 -0500 Received: from mail-ob0-f175.google.com ([209.85.214.175]:63594) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1QYl-0005ae-LU for 19390@debbugs.gnu.org; Wed, 17 Dec 2014 21:11:24 -0500 Received: by mail-ob0-f175.google.com with SMTP id wp4so572480obc.6 for <19390@debbugs.gnu.org>; Wed, 17 Dec 2014 18:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=1dt0zbRWH1bjO/c7RyOXRMXtobETanQq5LxTERklDjo=; b=AZaglBhxGaY/x8S8VdFTKZ5U41cVgCc7Z/eOix4CjceAlntbzotBx8A7au//+6DXop hbw78KSTJDShXSjXmUE6+ON8U5e3DR3ti4XhhW4lQyYrZQuNS+TC+bex/SYgSNp+reGG 9d9V9cuTcptXvUQers7WUxpDPUtKGYI4nVWnSqs7O04kT9nIOlyWLMqcMZiNF2pkKIkV y4JSgfHU5SNTAGYgLv+X0cBVNuB5Kb3ZdFqgj+kStZB/cWTeoifM/uaunAuzD7B2g5qn gO/iqdoUD0WxnaUo5asuMJg09pHY3JGneOQI8bv9of3WIS0qpwR5gaF6k6LOteBvp8RC 00IA== MIME-Version: 1.0 X-Received: by 10.182.58.102 with SMTP id p6mr19670377obq.84.1418868683225; Wed, 17 Dec 2014 18:11:23 -0800 (PST) Received: by 10.76.26.162 with HTTP; Wed, 17 Dec 2014 18:11:23 -0800 (PST) Received: by 10.76.26.162 with HTTP; Wed, 17 Dec 2014 18:11:23 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> Date: Thu, 18 Dec 2014 00:11:23 -0200 X-Google-Sender-Auth: WF3q78B2DezsnDehb4TfM0Y9xkE Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Stefan Monnier Content-Type: multipart/alternative; boundary=e89a8f83a8e1d8c05d050a741b79 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --e89a8f83a8e1d8c05d050a741b79 Content-Type: text/plain; charset=UTF-8 On 17 Dec 2014 23:38, "Stefan Monnier" wrote: > > > Good point, thanks. Here's the patch without the initial filtering part. > > Still an improvement over the current code (0.6s vs 2.1s on my machine). > > Just a side note: the most important optimization is to make sure that > the activation of all the installed packages at startup time is done > without going through this "reload previously loaded files". > > IIUC, this is the first optimization that was proposed in this thread, > and is the main one to install (regardless of the others). Has it > been installed? I agree. And no, IIUC this hasn't been implemented yet. I suggested a couple of style improvements and haven't heard back. If nobody has the time to do these improvements right now, then please apply the originally suggested patch and I'll make the improvements later, next time I have a few minutes. --e89a8f83a8e1d8c05d050a741b79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 17 Dec 2014 23:38, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote= :
>
> > Good point, thanks. Here's the patch without the initial filt= ering part.
> > Still an improvement over the current code (0.6s vs 2.1s on my ma= chine).
>
> Just a side note: the most important optimization is to make sure that=
> the activation of all the installed packages at startup time is done > without going through this "reload previously loaded files".=
>
> IIUC, this is the first optimization that was proposed in this thread,=
> and is the main one to install (regardless of the others).=C2=A0 Has i= t
> been installed?

I agree. And no, IIUC this hasn't been implemented yet. = I suggested a couple of style improvements and haven't heard back.
If nobody has the time to do these improvements right now, then please appl= y the originally suggested patch and I'll make the improvements later, = next time I have a few minutes.

--e89a8f83a8e1d8c05d050a741b79-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 05:37:28 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 10:37:28 +0000 Received: from localhost ([127.0.0.1]:49481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1YSV-0001OJ-De for submit@debbugs.gnu.org; Thu, 18 Dec 2014 05:37:27 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:50727) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1YST-0001OB-SP for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 05:37:26 -0500 Received: by mail-wg0-f53.google.com with SMTP id l18so1189154wgh.26 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 02:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1kYeKdAozWVNkXV1UAMYTxmLsLCgW3KXiMUZ+luxCN8=; b=iDla5MCNj5keVx0ddlvUYy1L2IBlzu3REx2OaFnkVuEFAJozJQjQzipkS0XHQjdWp1 tlKiFQcg7ATzOzinYaG1Z6Dr8dv0jqarfythwCEUaa52FNlzDrddtairJT23rP1d44Uj qbZ0USseMas7tp9TKcB9O3SlhgSQWmifac8uDkt/H7h/rxbMwzDUTpF3SXhqlaSH1Z2m ciPxn7g/f0QvaZkG3k9ZMlZCEgnUABUrywJC6C/D0sksr9sRIqrLd0m3ZWsKhuoZ8NCC Vcc/Q6p1dD+7wguwtZfV0BFnX6YhYHe+VUnGohw9Z1rvjp63xysuVjO70UIayrOUlqWt eZzQ== X-Received: by 10.194.79.199 with SMTP id l7mr2967583wjx.136.1418899045042; Thu, 18 Dec 2014 02:37:25 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id u9sm8399456wjy.37.2014.12.18.02.37.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 02:37:24 -0800 (PST) Message-ID: <5492AE61.3040902@yandex.ru> Date: Thu, 18 Dec 2014 12:37:21 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com, Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 04:11 AM, Artur Malabarba wrote: > I agree. And no, IIUC this hasn't been implemented yet. I suggested a > couple of style improvements and haven't heard back. Sorry, got sidetracked. Installed with suggestions, except for the last docstring line (too obvious IMO). Still, I think we'd rather not spend too much time on reloading packages when upgrading, so please consider my latest patch. Aside from it, if we compare with the alternative implementation suggestions, the current one reloads all dependencies, even those that haven't been (re)installed during the current session. That comes to about ~200 ms if the package in question only depends on Helm (44 files). Someone should try that with Org installed from ELPA. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 09:30:29 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 14:30:29 +0000 Received: from localhost ([127.0.0.1]:49595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1c60-0000BA-4M for submit@debbugs.gnu.org; Thu, 18 Dec 2014 09:30:28 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:65349) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1c5o-0000Ao-OJ for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 09:30:17 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102886290" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 09:30:16 -0500 Received: by pastel.home (Postfix, from userid 20848) id F3BE62D79; Thu, 18 Dec 2014 09:30:15 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> Date: Thu, 18 Dec 2014 09:30:15 -0500 In-Reply-To: <5492AE61.3040902@yandex.ru> (Dmitry Gutov's message of "Thu, 18 Dec 2014 12:37:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, bruce.connor.am@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Aside from it, if we compare with the alternative implementation > suggestions, the current one reloads all dependencies, even those that > haven't been (re)installed during the current session. It sounds serious, but I don't understand what you're referring to. Can you give an example? Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 09:47:27 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 14:47:27 +0000 Received: from localhost ([127.0.0.1]:49600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1cMR-0000c5-8p for submit@debbugs.gnu.org; Thu, 18 Dec 2014 09:47:27 -0500 Received: from mail-wg0-f43.google.com ([74.125.82.43]:37218) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1cMO-0000bv-CX for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 09:47:24 -0500 Received: by mail-wg0-f43.google.com with SMTP id l18so1839820wgh.16 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 06:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=er0D0LcKg1Lf7fgGLMgljSOQ9xy501f6lHk64jWy5AQ=; b=bsdwDs9bJnl3COW6L/vVtIa5gTGdUWtm886v5Do4fnl1m2tg1mev9QRvR5NdUXgARp rMBIS8obLTgSrnvgm3/KhO2PRAMXuVMmM5srT8jVTmpwkkjjCbq6XEdH18KAkIY4FczJ E9SEQYBdX+RwHm5FClx/rAlI4QxHqzL9OZ4fcJyRqbJ+UhRqoZgBjEpQuSlQdz4rxz1U ZnolSF+mvCRGvakTx3KxHIjKD3ot+ZQ2nqYdddr8voq+2KPYUeASkymchTwlKaFUIhKe XSCqZ2EGnQmbvzhqcOWQDu83K9uDyPQKiZxFp3Z+xHcksg4ny6MEe49SVcrFIx8x/QTZ AE9g== X-Received: by 10.180.77.7 with SMTP id o7mr5690533wiw.81.1418914043378; Thu, 18 Dec 2014 06:47:23 -0800 (PST) Received: from axl (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id fo12sm25024212wic.19.2014.12.18.06.47.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:47:22 -0800 (PST) From: Dmitry Gutov To: Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> Date: Thu, 18 Dec 2014 16:47:20 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 18 Dec 2014 09:30:15 -0500") Message-ID: <868ui5aubr.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, bruce.connor.am@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stefan Monnier writes: >> Aside from it, if we compare with the alternative implementation >> suggestions, the current one reloads all dependencies, even those that >> haven't been (re)installed during the current session. > > It sounds serious, but I don't understand what you're referring to. > Can you give an example? It reloads all dependencies of the package that is currently being installed. Try this: (advice-add 'package-activate-1 :before (lambda (pkg-desc &optional reload) (message "package-activate-1 called with %s %s" (package-desc-name pkg-desc) reload)) '((name . "Parrot arguments"))) Then install company (if your haven't yet), and then, with Melpa in package archives, install company-math. You'll see this in *Messages*: package-activate-1 called with company force package-activate-1 called with math-symbol-lists force package-activate-1 called with company-math force From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 10:15:21 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 15:15:21 +0000 Received: from localhost ([127.0.0.1]:50215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1cnQ-0001RX-QA for submit@debbugs.gnu.org; Thu, 18 Dec 2014 10:15:21 -0500 Received: from mail-oi0-f41.google.com ([209.85.218.41]:63725) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1cnN-0001RO-ID for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 10:15:18 -0500 Received: by mail-oi0-f41.google.com with SMTP id a3so505949oib.14 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 07:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=nnfkAJlrtvnXc1l6nYLXSvbjVYcN5uQoRqyvwzr6IWo=; b=kbFavIwrc4NGeQ7kpTgHchZtRhSi1xgPk13AO/SIFiTq6Si7vpCuLLAbAHwjLS4pIP NI+Fty+DSas4NT3gYOyrCfFARAF6plvIPvks9nyr648tdfAUU3uZCDhcTBT+QTp6WsZF BT3nvsyErEki9emhTNSSPxr0/75eFuHtJDXIVpJNoJQ7BKGlbT5L2hLY1XF/5waGS2rR 2z96XSl8/xz51KMHaSiNhjFIy4V+sni5wRtGiWZrkxnbrpD5AWJ5wWuogtI/hoepDjDa cN33EcMpwRMFvlt6RDLOSAzGBfmztXTFz1m0qUAlzWWOnZW7hZDZnAhckZODmJClpjwZ nqog== MIME-Version: 1.0 X-Received: by 10.182.102.161 with SMTP id fp1mr1616311obb.29.1418915717125; Thu, 18 Dec 2014 07:15:17 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 07:15:16 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 07:15:16 -0800 (PST) In-Reply-To: <5492AE61.3040902@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> Date: Thu, 18 Dec 2014 13:15:16 -0200 X-Google-Sender-Auth: ipMwuGCsdaot2rYnaplaRrpCAPs Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: multipart/alternative; boundary=089e0149c1ce491dc2050a7f0f7a X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --089e0149c1ce491dc2050a7f0f7a Content-Type: text/plain; charset=UTF-8 On 18 Dec 2014 08:37, "Dmitry Gutov" wrote: > > On 12/18/2014 04:11 AM, Artur Malabarba wrote: > >> I agree. And no, IIUC this hasn't been implemented yet. I suggested a >> couple of style improvements and haven't heard back. > > > Sorry, got sidetracked. Installed with suggestions, except for the last docstring line (too obvious IMO). Awesome :-) > Still, I think we'd rather not spend too much time on reloading packages when upgrading, so please consider my latest patch. There's a bit of a small flaw with that approach, it's the reason I used find-library. If you just check load files against their names, you could find a wrong file that has the same name as a feature (we require files in the load path to be uniquely named, but load-history contains all files, not just those in the load path). It's an edge case, and my opinion is that a good performance improvement is more important than that. But it seems like the 2 biggest performance improvements have already been made (the package initialize, and the file true name), so I wonder if it's worth it. > Aside from it, if we compare with the alternative implementation suggestions, the current one reloads all dependencies, even those that haven't been (re)installed during the current session. Is that so? Reading your patch, and from what I understand of the current implementation, they only reload packages on installation. So they shouldn't reload dependencies that weren't upgraded. --089e0149c1ce491dc2050a7f0f7a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 18 Dec 2014 08:37, "Dmitry Gutov" <dgutov@yandex.ru> wrote:
>
> On 12/18/2014 04:11 AM, Artur Malabarba wrote:
>
>> I agree. And no, IIUC this hasn't been implemented yet. I sugg= ested a
>> couple of style improvements and haven't heard back.
>
>
> Sorry, got sidetracked. Installed with suggestions, except for the las= t docstring line (too obvious IMO).

Awesome :-)

> Still, I think we'd rather not spend too much time = on reloading packages when upgrading, so please consider my latest patch.

There's a bit of a small flaw with that approach, it'= ;s the reason I used find-library.
If you just check load files against their names, you could find a wrong fi= le that has the same name as a feature (we require files in the load path t= o be uniquely named, but load-history contains all files, not just those in= the load path).

It's an edge case, and my opinion is that a good perform= ance improvement is more important than that. But it seems like the 2 bigge= st performance improvements have already been made (the package initialize,= and the file true name), so I wonder if it's worth it.

> Aside from it, if we compare with the alternative imple= mentation suggestions, the current one reloads all dependencies, even those= that haven't been (re)installed during the current session.

Is that so? Reading your patch, and from what I understand o= f the current implementation, they only reload packages on installation. So= they shouldn't reload dependencies that weren't upgraded.

--089e0149c1ce491dc2050a7f0f7a-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 10:39:56 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 15:39:56 +0000 Received: from localhost ([127.0.0.1]:50236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dBE-00026K-2f for submit@debbugs.gnu.org; Thu, 18 Dec 2014 10:39:56 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:61561) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dBA-000267-At for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 10:39:52 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so3865080obc.4 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 07:39:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=/bs0ipPlv4wydIBL3LiISepMBwJ3HB+UGALi01bQ7Ww=; b=jw7rn3dZFDDIzkHIsA+BP4lVa4KNooIFZUztm6ua65aK7M0VzDLtP4R09B6xQKpKzN 00/svstG55GUZGgnSMgb/JkBTvqlY/7ZchWP/aE6RtqLKsoEg8ZgGCxMMdm1pXUZWt/7 jeXPohC3y94RwZGMrayeS//aarH41b2oEW+C6PafWmbu1ed62CwiuGruYZHevw4LgQlr 7/KSaEq94o5fQIl48v4tr20lpG9Q+RboqNdOiM649nmaEzabG6e+chjranreDLKtBOJ9 IVGtuh+FGhLuGDN7ERvBNxvBYnjSbijEk73Nnw1r/klPOxc85wka0b1yem3xfdp6hMDn m7OQ== MIME-Version: 1.0 X-Received: by 10.182.231.230 with SMTP id tj6mr1741379obc.58.1418917191622; Thu, 18 Dec 2014 07:39:51 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 07:39:51 -0800 (PST) In-Reply-To: <868ui5aubr.fsf@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> Date: Thu, 18 Dec 2014 13:39:51 -0200 X-Google-Sender-Auth: JWo2228tsV9IUfw8wKKu7fbkxys Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) I see what you meant now. The RELOAD argument should not be passed to package-activate-1 when activating dependencies. That should fix the issue. The dependency will already have been reloaded when (if) it was upgraded. 2014-12-18 12:47 GMT-02:00 Dmitry Gutov : > Stefan Monnier writes: > >>> Aside from it, if we compare with the alternative implementation >>> suggestions, the current one reloads all dependencies, even those that >>> haven't been (re)installed during the current session. >> >> It sounds serious, but I don't understand what you're referring to. >> Can you give an example? > > It reloads all dependencies of the package that is currently being > installed. > > Try this: > > (advice-add 'package-activate-1 :before > (lambda (pkg-desc &optional reload) > (message "package-activate-1 called with %s %s" > (package-desc-name pkg-desc) reload)) > '((name . "Parrot arguments"))) > > Then install company (if your haven't yet), and then, with Melpa in > package archives, install company-math. You'll see this in *Messages*: > > package-activate-1 called with company force > package-activate-1 called with math-symbol-lists force > package-activate-1 called with company-math force From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 10:45:22 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 15:45:22 +0000 Received: from localhost ([127.0.0.1]:50240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dGT-0002GT-Us for submit@debbugs.gnu.org; Thu, 18 Dec 2014 10:45:22 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]:46905) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dGR-0002GL-P7 for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 10:45:20 -0500 Received: by mail-wi0-f176.google.com with SMTP id ex7so2193680wid.15 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 07:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=tSVOsy5Jf8NxPp7BQNi6Icn0Z+JU/GbQg7y8q4E0C8A=; b=QF3tKHietL2qJkSGSdjOh3ymH7vxrmJG3/Jn+MatI4VcYtviKlZi1rI4nEtvhTjPnB GMN73yZx7r/Uh1GS/Fnhlkr8LYRBM/jRz9C7cKzUx6A/tQeodZ3GgeHkDfU72vsHREyp fjPWk8AX518v5tV58UVOtA0dwbO87dGv0g2QzR2EW2nDFjdd4LHSzlrJNRXtXNxnmYpv 0li0nbYypKFG3SVXdNA5movLXjkGYKMNKhqH6Qv4s2Dzs0+4y+3jurDXoDHetFYuhEND yCQbPC1vFIr+jNxlCK9MTvg7ylCDVsMDpYWQp+cQrjkNwNA3K1bxzPhNX/1Jq4NirZK2 KT4Q== X-Received: by 10.194.48.109 with SMTP id k13mr5735342wjn.7.1418917518809; Thu, 18 Dec 2014 07:45:18 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id bs2sm9354490wjc.43.2014.12.18.07.45.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 07:45:18 -0800 (PST) Message-ID: <5492F68C.3090700@yandex.ru> Date: Thu, 18 Dec 2014 17:45:16 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 05:15 PM, Artur Malabarba wrote: > There's a bit of a small flaw with that approach, it's the reason I used > find-library. > If you just check load files against their names, you could find a wrong > file that has the same name as a feature (we require files in the load > path to be uniquely named, but load-history contains all files, not just > those in the load path). Like mentioned, we can also check against the `provide' values in each load-history element we find matching. Shouldn't be a perceptible performance hit. > It's an edge case, and my opinion is that a good performance improvement > is more important than that. But it seems like the 2 biggest performance > improvements have already been made (the package initialize, and the > file true name), so I wonder if it's worth it. 200ms per package initialization still seems a lot to me (even if it's only for certain packages). I also happen to think that the suggested code is a bit easier to understand, but it's up to you. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 10:47:59 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 15:47:59 +0000 Received: from localhost ([127.0.0.1]:50263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dJ0-0002Lv-W6 for submit@debbugs.gnu.org; Thu, 18 Dec 2014 10:47:59 -0500 Received: from mail-oi0-f45.google.com ([209.85.218.45]:51158) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dIz-0002Lo-Sv for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 10:47:58 -0500 Received: by mail-oi0-f45.google.com with SMTP id x69so554270oia.32 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 07:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=TqNRdk/1yR5G+ljry0YasKtiQ3nCl94ZYr5cv3u0pKw=; b=NRoZGKLZwsv/wCX6xLbvJ73csPDYn0QQKqdXDE/IFjZg/y31EU/32F6AlhMEI6BhKp 0i7n+9dhQEjuO2FloMKHBZVBFuUjmmjfWd+wbfprPAmcDm+Y0HYiJhT6VyJKgi2VGx1k TEr1ZnWc6ICTOYF7brw1toIMB8OYPjfSZYc/Z+4E2PgPIv5fxnJns9efgSdhA4yKZs+q EBa00PEJs6AkKmAMy/LFBZtk80O3OhZybScvHFqHV65SuJftr9FZuZfT52cRTXa3Kp42 EwF+2mgjZjnwKWRQTLCGODcvAmRripjR4NnzAcJyM8Cxz+fVKFY1R7TBKFRwDI84PsWO pzLw== MIME-Version: 1.0 X-Received: by 10.182.231.135 with SMTP id tg7mr1720898obc.62.1418917677146; Thu, 18 Dec 2014 07:47:57 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 07:47:57 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> Date: Thu, 18 Dec 2014 13:47:57 -0200 X-Google-Sender-Auth: t2l34cv9UVyJ_ja516gRRBktk0E Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) In retrospect, the cleanest way to do do all this would have been to build this reloading into `require' and `provide' (something would have to be done with autoloads too). Then package.el could go back to not worrying about it, and most of this discussion would be moot. The only problem I see with this is that we might have (much smaller) performance issues with `package-initialize` again, since `require' has no way of knowing whether it was invoked from inside `package-initialize'. The issue would be smaller because handling it inside `require' could be done more intelligently. 2014-12-18 13:39 GMT-02:00 Artur Malabarba : > I see what you meant now. The RELOAD argument should not be passed to > package-activate-1 when activating dependencies. That should fix the > issue. > > The dependency will already have been reloaded when (if) it was upgraded. > > 2014-12-18 12:47 GMT-02:00 Dmitry Gutov : >> Stefan Monnier writes: >> >>>> Aside from it, if we compare with the alternative implementation >>>> suggestions, the current one reloads all dependencies, even those that >>>> haven't been (re)installed during the current session. >>> >>> It sounds serious, but I don't understand what you're referring to. >>> Can you give an example? >> >> It reloads all dependencies of the package that is currently being >> installed. >> >> Try this: >> >> (advice-add 'package-activate-1 :before >> (lambda (pkg-desc &optional reload) >> (message "package-activate-1 called with %s %s" >> (package-desc-name pkg-desc) reload)) >> '((name . "Parrot arguments"))) >> >> Then install company (if your haven't yet), and then, with Melpa in >> package archives, install company-math. You'll see this in *Messages*: >> >> package-activate-1 called with company force >> package-activate-1 called with math-symbol-lists force >> package-activate-1 called with company-math force From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 10:49:59 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 15:49:59 +0000 Received: from localhost ([127.0.0.1]:50267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dKx-0002PE-Hh for submit@debbugs.gnu.org; Thu, 18 Dec 2014 10:49:59 -0500 Received: from mail-wi0-f175.google.com ([209.85.212.175]:55538) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dKv-0002P3-DG for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 10:49:57 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so2226902wiw.8 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 07:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=4cDWTq9tfxyfKRMPM1rca2QsAswyJSZ+rEe1V1kvnLA=; b=s9Cg90ACj0VYz/cQZqwtQWbGWWDEPhsgsTpdordEbtY6UTtXk4VL0hO9lzYfJAQv5H hT3wdq7b3eZPkk1Oj47NicBs1vxZ4krTdcVjllgJTM1DNzVv2m1Kl+y9oYBNGsQJJa8a LydXQbuMbWIKAf3HSeSt9uAMfKKYNswwN0CL6vlokib5Zy+11cP2G7zlTru8zDseAc6g apwWuV/xu2pO6fKI1+/vZKDfgkvMI8AUru2EjmEOMGJOgOiYXeraAL5x2sBwjHLeXpRA TcGrMqO4Ef0S9XPR3M9oY6I0ut7Ta4EdX08Gpms35CSRYy4Ga6LbptOjdUZq11QcJnfC KgCw== X-Received: by 10.194.57.43 with SMTP id f11mr5679083wjq.6.1418917796806; Thu, 18 Dec 2014 07:49:56 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id q7sm4596034wiv.8.2014.12.18.07.49.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 07:49:56 -0800 (PST) Message-ID: <5492F7A2.2050000@yandex.ru> Date: Thu, 18 Dec 2014 17:49:54 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 05:39 PM, Artur Malabarba wrote: > I see what you meant now. The RELOAD argument should not be passed to > package-activate-1 when activating dependencies. That should fix the > issue. Right! As long as packages are activated in the right order when installed together, this will be a good fix. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 11:14:47 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 16:14:47 +0000 Received: from localhost ([127.0.0.1]:50296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dix-00035G-4D for submit@debbugs.gnu.org; Thu, 18 Dec 2014 11:14:47 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:50155) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1div-000357-0S for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 11:14:45 -0500 Received: by mail-ob0-f176.google.com with SMTP id vb8so4019636obc.7 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 08:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=3df5KIKbbH9qmM5l170MNs6iO6bVG9FbbSUZXhDZtBg=; b=qqQKBPbKsMOJIfz2lWT5IN7EZHwke8CgcJ7DzAcf2JekNbKl1feHpgwmlclENogyUy DeLnWWy0F6a9h84WW+eEU2JvZov8Vm506OqamQJQWZM6hSDwKfDUCH/I8c+lI8rvqz5Z 3WsJpzfp23fiKxc+0tCYYGwSB5cDJG8LMTja6OkIUbw1+EhVlA0AEHYHxO0ZbhrZ8uyl FppPLfMvJMRNvWWwH/JJbCFX+11i++VQzOmK6caCkekQSQ1cCNJygiyLWZizMZOpRjjG HSNi4Fnwvn8IpZiMj4xbY692DAwNE+zlBG1H+HLAmyuPs8j3x6qlCSZBX3So1Vv+oaf6 Il8A== MIME-Version: 1.0 X-Received: by 10.182.231.135 with SMTP id tg7mr1803551obc.62.1418919284378; Thu, 18 Dec 2014 08:14:44 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 08:14:44 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 08:14:44 -0800 (PST) In-Reply-To: <868ui5aubr.fsf@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> Date: Thu, 18 Dec 2014 14:14:44 -0200 X-Google-Sender-Auth: Ws-8VSKTEzeAJQ3OabxadX07fmY Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: multipart/alternative; boundary=001a11c32a56e912ac050a7fe39b X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c32a56e912ac050a7fe39b Content-Type: text/plain; charset=UTF-8 I see what you mean now. The RELOAD argument should not be passed when activating dependencies. The dependency will already have been reloaded when (if) it was upgraded. Artur Malabarba On 18 Dec 2014 12:47, "Dmitry Gutov" wrote: > Stefan Monnier writes: > > >> Aside from it, if we compare with the alternative implementation > >> suggestions, the current one reloads all dependencies, even those that > >> haven't been (re)installed during the current session. > > > > It sounds serious, but I don't understand what you're referring to. > > Can you give an example? > > It reloads all dependencies of the package that is currently being > installed. > > Try this: > > (advice-add 'package-activate-1 :before > (lambda (pkg-desc &optional reload) > (message "package-activate-1 called with %s %s" > (package-desc-name pkg-desc) reload)) > '((name . "Parrot arguments"))) > > Then install company (if your haven't yet), and then, with Melpa in > package archives, install company-math. You'll see this in *Messages*: > > package-activate-1 called with company force > package-activate-1 called with math-symbol-lists force > package-activate-1 called with company-math force > --001a11c32a56e912ac050a7fe39b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I see what you mean now. The RELOAD argument should not be p= assed when activating dependencies.
The dependency will already have been reloaded when (if) it was upgraded. <= /p>

Artur Malabarba

On 18 Dec 2014 12:47, "Dmitry Gutov" &= lt;dgutov@yandex.ru> wrote:
Stefan Monnier <monnier@iro.umontreal.ca> wri= tes:

>> Aside from it, if we compare with the alternative implementation >> suggestions, the current one reloads all dependencies, even those = that
>> haven't been (re)installed during the current session.
>
> It sounds serious, but I don't understand what you're referrin= g to.
> Can you give an example?

It reloads all dependencies of the package that is currently being
installed.

Try this:

(advice-add 'package-activate-1 :before
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (pkg-desc &optional r= eload)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "package-act= ivate-1 called with %s %s"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(package-desc-name pkg-desc) reload))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '((name . "Parrot argume= nts")))

Then install company (if your haven't yet), and then, with Melpa in
package archives, install company-math. You'll see this in *Messages*:<= br>
package-activate-1 called with company force
package-activate-1 called with math-symbol-lists force
package-activate-1 called with company-math force
--001a11c32a56e912ac050a7fe39b-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 11:16:04 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 16:16:04 +0000 Received: from localhost ([127.0.0.1]:50304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dkC-00038F-En for submit@debbugs.gnu.org; Thu, 18 Dec 2014 11:16:04 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:49086) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1dk9-00037Z-UF for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 11:16:02 -0500 Received: by mail-wi0-f172.google.com with SMTP id n3so2321086wiv.5 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 08:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6Z6UJng0n9JnEzPYXo5eQKB6I6pXQgbJICEEGm81A+U=; b=wJp6UEisJVcWJpiwuP43dY/psOyc+QhhAlYeqKsxVlih1m5+Pn42jaFS7cEOFpRmFU NNHhoD2/jZYfxzH1exft2dTDUdXvmarEPZNPeVm7UPdmQrP9A9v3fa/pNIfw7keiN+YP j1HkBUxq2k1DcxaUnT9tJeWngGzUvdY49iUWnCcLI3yoWScKiH9kF7ztyYs0OjKm8GBP jJTVM921NaN+tLYX+qtAuVYNMUFxxvytS5c1ADXOkKdYz6uIQQPcRVAqI8eF6H/ZzE2U fJ20knffRibzFKrH0ScabEh8YTt4SkfIwHffEkd8RnL7jNdjCbndUopTPG1fz0hxl01i AVVA== X-Received: by 10.180.96.33 with SMTP id dp1mr26017751wib.13.1418919359957; Thu, 18 Dec 2014 08:15:59 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id mo12sm9455967wjc.35.2014.12.18.08.15.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 08:15:59 -0800 (PST) Message-ID: <5492FDBD.1040704@yandex.ru> Date: Thu, 18 Dec 2014 18:15:57 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 05:47 PM, Artur Malabarba wrote: > In retrospect, the cleanest way to do do all this would have been to > build this reloading into `require' and `provide' (something would I dunno, seems like if `require' has to consult `find-library-name' each time, it would lower its performance. Maybe even perceptibly, since it's called a lot. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 11:45:16 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 16:45:16 +0000 Received: from localhost ([127.0.0.1]:50380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1eCS-0003wJ-BI for submit@debbugs.gnu.org; Thu, 18 Dec 2014 11:45:16 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:35092) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1eCQ-0003w9-F0 for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 11:45:15 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so2447996wid.17 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 08:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=5egFS2EWkKBsAtJS0bvBhU4ikaGgMCfI8wRIkxjZ2oI=; b=RTWMXGjozaqxkokL4VfJzc5gcnV3C2/5KYjAAcqNVXQnpPzDeHl6NgOfE2uXabJ6Yo RNrt4VD4fpxvzfAogmOJRkN9u2Ntp2NFN3SmPQdcRggPajm5czHuATTA3cbX1ptuS5lv R0AY6kjU9YReejV4MOsOYNfLSvw4+hpA9JzXv0WUp4x6OwpfYdjRuxChYmkvx/rfvqTL yoVFuBKiOlGSQWFHa+zwQfr8S0qdnaRw6HrC0EwSHZNDc/sfqDFZ5MYNKIuQtURtULd1 W86+ze6hW87y7R2RI5ncdvjMd+XCQUHw8b7BreEq6/qryipNY73cQ2HpoQbXnX8a9zlR YaZw== X-Received: by 10.180.103.6 with SMTP id fs6mr25571484wib.11.1418921113620; Thu, 18 Dec 2014 08:45:13 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id fo12sm25380808wic.19.2014.12.18.08.45.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 08:45:13 -0800 (PST) Message-ID: <54930497.7000606@yandex.ru> Date: Thu, 18 Dec 2014 18:45:11 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: Stefan Monnier , 19390@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 05:39 PM, Artur Malabarba wrote: > The RELOAD argument should not be passed to package-activate-1 when activating dependencies. And done. Please consider the performance patch at your leisure. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 12:39:36 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 17:39:36 +0000 Received: from localhost ([127.0.0.1]:50443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1f31-0005PE-21 for submit@debbugs.gnu.org; Thu, 18 Dec 2014 12:39:35 -0500 Received: from mail-oi0-f49.google.com ([209.85.218.49]:37385) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1f2x-0005P4-LY for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 12:39:32 -0500 Received: by mail-oi0-f49.google.com with SMTP id i138so692878oig.8 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 09:39:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=AoEJYmiPlEvuvyluEQm+4NAXYUeumVtxWpwAH43lQEY=; b=wOhaqcrRLkiA9Rwaitzle9BhUJ89TflqVmHamFOZKsOq5TlmY2BoI972aYZ/sx1hK4 eYZ+qaIE7ixhxbewetEOgUPqFOHMHpxQnZ9u1KtfPXsXQCWgFXzV3iDo/k+7/z8Sng8v gVKsiFy1FvmsxH0pOhSGDSuwOw/UXwK9fLtU0eOGmJXirjQqOJdRwYGNIUvOHKJoCRN3 gHT9sDM5olS9M4qQ65mmV+XtQGi6r2UouYJW8AHXi6ABN0SOoNOe3yheO0WfXXmMHT89 vkyukE7Ooxz+EXkq7QFjm8YNvdjmwFDO7KEYw1dJoZXXuDXsVH2UmBMENj8uNVKWcVel u8hQ== MIME-Version: 1.0 X-Received: by 10.60.62.241 with SMTP id b17mr1070308oes.17.1418924370914; Thu, 18 Dec 2014 09:39:30 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 09:39:30 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 09:39:30 -0800 (PST) In-Reply-To: <5492F68C.3090700@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> Date: Thu, 18 Dec 2014 15:39:30 -0200 X-Google-Sender-Auth: ImDHtSFKKsUWpUVmZpv_sD_vNpE Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: multipart/alternative; boundary=001a11c21ca8177629050a8113f5 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c21ca8177629050a8113f5 Content-Type: text/plain; charset=UTF-8 On 18 Dec 2014 13:45, "Dmitry Gutov" wrote: > > On 12/18/2014 05:15 PM, Artur Malabarba wrote: > >> There's a bit of a small flaw with that approach, it's the reason I used >> find-library. >> If you just check load files against their names, you could find a wrong >> file that has the same name as a feature (we require files in the load >> path to be uniquely named, but load-history contains all files, not just >> those in the load path). > > > Like mentioned, we can also check against the `provide' values in each load-history element we find matching. Shouldn't be a perceptible performance hit. > If it's trivial to do, that's certainly good. >> It's an edge case, and my opinion is that a good performance improvement >> is more important than that. But it seems like the 2 biggest performance >> improvements have already been made (the package initialize, and the >> file true name), so I wonder if it's worth it. > > > 200ms per package initialization still seems a lot to me (even if it's only for certain packages). I also happen to think that the suggested code is a bit easier to understand, but it's up to you. During package-initialize these things add up, so that's certainly a lot. But during a regular upgrade, what fraction of the total load time does that amount to? Even for large packages like helm I think this percentage should be small. But --001a11c21ca8177629050a8113f5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 18 Dec 2014 13:45, "Dmitry Gutov" <dgutov@yandex.ru> wrote:
>
> On 12/18/2014 05:15 PM, Artur Malabarba wrote:
>
>> There's a bit of a small flaw with that approach, it's the= reason I used
>> find-library.
>> If you just check load files against their names, you could find a= wrong
>> file that has the same name as a feature (we require files in the = load
>> path to be uniquely named, but load-history contains all files, no= t just
>> those in the load path).
>
>
> Like mentioned, we can also check against the `provide' values in = each load-history element we find matching. Shouldn't be a perceptible = performance hit.
>

If it's trivial to do, that's certainly good.

>> It's an edge case, and my opinion is that a goo= d performance improvement
>> is more important than that. But it seems like the 2 biggest perfo= rmance
>> improvements have already been made (the package initialize, and t= he
>> file true name), so I wonder if it's worth it.
>
>
> 200ms per package initialization still seems a lot to me (even if it&#= 39;s only for certain packages). I also happen to think that the suggested = code is a bit easier to understand, but it's up to you.

During package-initialize these things add up, so that's= certainly a lot. But during a regular upgrade, what fraction of the total = load time does that amount to? Even for large packages like helm I think th= is percentage should be small. But

--001a11c21ca8177629050a8113f5-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 12:50:32 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 17:50:32 +0000 Received: from localhost ([127.0.0.1]:50458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fDb-0005g5-IU for submit@debbugs.gnu.org; Thu, 18 Dec 2014 12:50:31 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:65235) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fDZ-0005fw-5w for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 12:50:29 -0500 Received: by mail-oi0-f51.google.com with SMTP id e131so718971oig.10 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 09:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=e3LUWuCZgo9cBOY3aodqEuxLPNuxjGGQrc18rde3mhI=; b=ykMSRd9NBq4xjDi+GRiCg+Qm5QHuB0miy/zYLWjj1o7YO5ixh69xaev/iFbiM+c5Wv oRbc4MsCMHn5huV9ujlmNW+Ws90ggM1PHXNYk/vmywPenyeqEmfgGJIy6cK4iNs/W0Dp UJu/HVuhw+18SlqHypdy9BfT588/y4C/ciZe1seUKjq8iXD6jjrGYU7cKcleu5QRmK9U /y1PAS/OnxMks/SxniT/EXD5Up6mnrit8vd2z2gdWrC1m/3qgqM8hTZ71b8gQqeziell pJpI9Qdxlj8tAhY1bvlvo6ErlF2AP3xn+kDzTsbXYeu/3z1ux9HNXgd6kFx4SVSZaElM NKEw== MIME-Version: 1.0 X-Received: by 10.202.173.198 with SMTP id w189mr1951370oie.27.1418925028500; Thu, 18 Dec 2014 09:50:28 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 09:50:28 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 09:50:28 -0800 (PST) In-Reply-To: <5492FDBD.1040704@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> Date: Thu, 18 Dec 2014 15:50:28 -0200 X-Google-Sender-Auth: Y1CqT1LHjnQjJBqSg0GPpBL7pOg Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: multipart/alternative; boundary=001a113eabb4496d3c050a813a5f X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113eabb4496d3c050a813a5f Content-Type: text/plain; charset=UTF-8 On 18 Dec 2014 14:15, "Dmitry Gutov" wrote: > > On 12/18/2014 05:47 PM, Artur Malabarba wrote: >> >> In retrospect, the cleanest way to do do all this would have been to >> build this reloading into `require' and `provide' (something would > > > I dunno, seems like if `require' has to consult `find-library-name' each time, it would lower its performance. > > Maybe even perceptibly, since it's called a lot. There's a way we can implement this so that find library and file-truename have to be called exactly once per require (and file-truename is called once per provide). Yes, there will be a performance hit, but one could argue that is the way require should have been done from the start (the "right way"). I don't think this performance hit will be noticeable during regular package loading. How expensive is it to call find-library and file-truename once per require, compared to the time it takes to actually load (possibly byte-compile) the entire library that's calling these requires? The performance difference will certainly be noticeable during package-initialize. Like I mentioned above, that's an important issue. --001a113eabb4496d3c050a813a5f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 18 Dec 2014 14:15, "Dmitry Gutov" <dgutov@yandex.ru> wrote:
>
> On 12/18/2014 05:47 PM, Artur Malabarba wrote:
>>
>> In retrospect, the cleanest way to do do all this would have been = to
>> build this reloading into `require' and `provide' (somethi= ng would
>
>
> I dunno, seems like if `require' has to consult `find-library-name= ' each time, it would lower its performance.
>
> Maybe even perceptibly, since it's called a lot.

There's a way we can implement this so that find library= and file-truename have to be called exactly once per require (and file-tru= ename is called once per provide).
Yes, there will be a performance hit, but one could argue that is the way r= equire should have been done from the start (the "right way").

I don't think this performance hit will be noticeable du= ring regular package loading. How expensive is it to call find-library and = file-truename once per require, compared to the time it takes to actually l= oad (possibly byte-compile) the entire library that's calling these req= uires?

The performance difference will certainly be noticeable duri= ng package-initialize. Like I mentioned above, that's an important issu= e.

--001a113eabb4496d3c050a813a5f-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 12:52:23 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 17:52:23 +0000 Received: from localhost ([127.0.0.1]:50462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fFP-0005iv-56 for submit@debbugs.gnu.org; Thu, 18 Dec 2014 12:52:23 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:54562) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fFM-0005im-TB for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 12:52:21 -0500 Received: by mail-wg0-f50.google.com with SMTP id a1so2304557wgh.37 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 09:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7CSY2hDgbGYRCSU/YaI5gMzHQmpS3j3IwcqHQoRLSIk=; b=YD5/NpT672kV5JyEN1z47HPbi2deoFpePTejVmjdxIsfKUVA7FX/GJR/HHKgzOcgLS 2GMErtAWQmQkTjDDLE94QksP6VOU7CVTTxQ6RdI/N/5/vw6bioWSsns+T2g23x9Fc9I0 jLMz9bTi5AP01dn5T8w450oxceGHR0hm6RBOqZnFP1PzBA70AqQ5sl+WXDSq7Un6n9Oc Z1yxKlhHMgkBTrNbxL7HthP0LFIv9DWH1e5lck2cV4wnwtG+hd0uyAoBSsAMxYIHIdKp TLziel1q8dE9OcKGOQJPVGoDgtUdWr1erqHCxS278LN8BYMzr7KAE2FjWDAsIwaw58dB CDVA== X-Received: by 10.180.90.176 with SMTP id bx16mr6002550wib.0.1418925140238; Thu, 18 Dec 2014 09:52:20 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id je12sm10777896wic.22.2014.12.18.09.52.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 09:52:19 -0800 (PST) Message-ID: <54931452.30000@yandex.ru> Date: Thu, 18 Dec 2014 19:52:18 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 07:39 PM, Artur Malabarba wrote: > During package-initialize these things add up, so that's certainly a > lot. But during a regular upgrade, what fraction of the total load time > does that amount to? Even for large packages like helm I think this > percentage should be small. But ^^ The message cuts off here. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 12:54:36 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 17:54:36 +0000 Received: from localhost ([127.0.0.1]:50470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fHY-0005ml-GJ for submit@debbugs.gnu.org; Thu, 18 Dec 2014 12:54:36 -0500 Received: from mail-wg0-f51.google.com ([74.125.82.51]:58319) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fHW-0005ma-MR for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 12:54:35 -0500 Received: by mail-wg0-f51.google.com with SMTP id x12so2281774wgg.38 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 09:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=C3dHVbXHvZr60YjSQM4eX1WFU/VY308wd2gKjRUxBJ8=; b=mCfcv0UNujDEWVLpv60ieFwcWrbRCkvHqZzq1iQXNkbN9nJopZOS8uPmPX7e+vIKiu qJVPoY5NvXjyn14ACqSb+77sxuYx7glC9cdSobaAwirzCORT1cm3qlNJNwaJD/y3sbQT yVS8tEl7G/XBVsWHeVZDt6y/YbsFY3Ppx30GCXjpT8gcbt21wIL3DvGhobVnBdrpXfHZ 1mD72XrKn+Ra4OEv0lva3ooAUm8VTPoTLjzTxZIAdCxSRRVGGL+KI5kSJIfeyRTXPqBY UXHS3kZXY/I8PBnfk2YyTBqNev2nhAyvz6SagLLlU+eyNmfFfLoH4gAkjiG+OuksVZte o8/Q== X-Received: by 10.194.109.6 with SMTP id ho6mr6706749wjb.93.1418925274047; Thu, 18 Dec 2014 09:54:34 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id gf6sm9779917wjc.11.2014.12.18.09.54.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 09:54:33 -0800 (PST) Message-ID: <549314D7.8070106@yandex.ru> Date: Thu, 18 Dec 2014 19:54:31 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 07:50 PM, Artur Malabarba wrote: > I don't think this performance hit will be noticeable during regular > package loading. It'll probably slow down Emacs startup: `require' will have to call `find-library-name' for each common feature that someone depends on, each time a dependant is loaded. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 13:37:42 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 18:37:42 +0000 Received: from localhost ([127.0.0.1]:50513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fxG-0006tl-BL for submit@debbugs.gnu.org; Thu, 18 Dec 2014 13:37:42 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:38324) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1fxE-0006tc-7q for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 13:37:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQEDAQEBAQEdkG8HhEgFiwGMVQWXVIF4hBkhgncBAQE X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQEDAQEBAQEdkG8HhEgFiwGMVQWXVIF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102911481" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 13:37:39 -0500 Received: by pastel.home (Postfix, from userid 20848) id 3362F2D79; Thu, 18 Dec 2014 13:37:39 -0500 (EST) From: Stefan Monnier To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> Date: Thu, 18 Dec 2014 13:37:39 -0500 In-Reply-To: (Artur Malabarba's message of "Thu, 18 Dec 2014 13:47:57 -0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > build this reloading into `require' and `provide' (something would > have to be done with autoloads too). No, that's too high-level. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 13:40:40 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 18:40:40 +0000 Received: from localhost ([127.0.0.1]:50517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g07-0006yI-Pk for submit@debbugs.gnu.org; Thu, 18 Dec 2014 13:40:40 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27113) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g06-0006yA-K7 for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 13:40:38 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDh8HEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvBwqEPgWLAYxVBZdUgXiEGSGCdwEBAQ X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIxALDh8HEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvBwqEPgWLAYxVBZdUgXiEGSGCdwEBAQ X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102911742" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 13:40:38 -0500 Received: by pastel.home (Postfix, from userid 20848) id 9D9952D79; Thu, 18 Dec 2014 13:40:37 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> <549314D7.8070106@yandex.ru> Date: Thu, 18 Dec 2014 13:40:37 -0500 In-Reply-To: <549314D7.8070106@yandex.ru> (Dmitry Gutov's message of "Thu, 18 Dec 2014 19:54:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, bruce.connor.am@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> I don't think this performance hit will be noticeable during regular >> package loading. > It'll probably slow down Emacs startup: `require' will have to call > `find-library-name' for each common feature that someone depends on, each > time a dependant is loaded. And more importantly, we suffer the slow down when require is supposed to be fast (i.e. when the package has already been loaded), so the relative speed impact is not negligible. And doing it in `require' doesn't catch all cases, because it's done too lazily and doesn't account for packages loaded via autoloads. Doing the reloads eagerly when a package is (re)activated is the better choice. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 13:42:10 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 18:42:10 +0000 Received: from localhost ([127.0.0.1]:50521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g1a-00070x-7X for submit@debbugs.gnu.org; Thu, 18 Dec 2014 13:42:10 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:38662) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g1Y-00070p-RV for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 13:42:09 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102911855" Received: from 206-248-130-192.dsl.teksavvy.com (HELO pastel.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 13:42:08 -0500 Received: by pastel.home (Postfix, from userid 20848) id 27BDE2D79; Thu, 18 Dec 2014 13:42:08 -0500 (EST) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> Date: Thu, 18 Dec 2014 13:42:08 -0500 In-Reply-To: <5492F68C.3090700@yandex.ru> (Dmitry Gutov's message of "Thu, 18 Dec 2014 17:45:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, bruce.connor.am@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 200ms per package initialization still seems a lot to me (even if it's only > for certain packages). We should only pay this price at the moment we upgrade a library, so the cost should be negligible compared to downloading&byte-compiling. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 13:45:59 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 18:45:59 +0000 Received: from localhost ([127.0.0.1]:50525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g5G-00076j-QE for submit@debbugs.gnu.org; Thu, 18 Dec 2014 13:45:59 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:46470) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1g5E-00076b-P0 for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 13:45:57 -0500 Received: by mail-wi0-f180.google.com with SMTP id n3so2847834wiv.1 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 10:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Oh3RK8PB300X5SrlHaYqWba54R2IkcT/zhXkUTww1Cw=; b=BaCu9a9hnoqX0zW56RHmyeS0O9sM7GapiokM5ob6PsMc84dIVmTkgI+DBSGAli6eV3 s8vKWmxxlK94kCGS94B7u4LALDR0oGVpaXcjImQZ7UqdOC2sVFCoBrB55Zc6Z126S127 gkDBuuie9JsfFcF+AmftH8TswEsJ4Yct7M1GlNt30yBGGF22rsREOzOtRSHSMjyBYUIs ntwfImc4U/LsYI6isDKHqoWXgJ3aSrmeYMxxRIzcFXkGDVtaIPkSYEFDp6Tm6QsBmKS5 yluNTAXcm1KwXZ6f1DiL/gjzlKHuOCx45syStB+fZjLgfsOcgEFbl/AJAxCiVf/hxN2J XLWw== X-Received: by 10.194.190.19 with SMTP id gm19mr7111699wjc.51.1418928354561; Thu, 18 Dec 2014 10:45:54 -0800 (PST) Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id bs2sm9902099wjc.43.2014.12.18.10.45.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 10:45:53 -0800 (PST) Message-ID: <549320E0.6040602@yandex.ru> Date: Thu, 18 Dec 2014 20:45:52 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, bruce.connor.am@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 08:42 PM, Stefan Monnier wrote: > We should only pay this price at the moment we upgrade a library, so the > cost should be negligible compared to downloading&byte-compiling. That is true. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 14:01:40 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 19:01:40 +0000 Received: from localhost ([127.0.0.1]:50534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1gKS-0007VQ-3p for submit@debbugs.gnu.org; Thu, 18 Dec 2014 14:01:40 -0500 Received: from mail-ob0-f173.google.com ([209.85.214.173]:32794) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1gKQ-0007VJ-PZ for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 14:01:39 -0500 Received: by mail-ob0-f173.google.com with SMTP id uy5so4861906obc.4 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 11:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=bKI1JIgreoxwl+WZ1OVL6QHVz5+mSOPJZYCTqpUHRwQ=; b=dMWYZORvlaf4xDzBRehqiJIEKOSp2IG3Fyn+ZaB8cX1SaGOnUo2wWa+e4sJYdo/GfU CxugzHLsnZOeowXmMOOalJ9+lI9sivCbv370DtFi+ABx6CTKm92q6Zr3qKYZGQjQya7o 2pR8DO4BjjJcktFu8e0colbJ5iWB7qwo+28CWE7wK8XbWepTdZOUlMJk+NaBqYwjea9b Q2v2POiQ/aeUcCK/8+rblGeuZnNUZ+ivro5FvGOalE8W3nJmXBDHeNhL3HY8Ll0xvA3B kmuwL4F7jqm9jwH1ihpyqyoIJlNgYTuYvPHubKs96fsSNh3aQY0V/y7nB56A1US2aSJX mWig== MIME-Version: 1.0 X-Received: by 10.202.188.66 with SMTP id m63mr2196772oif.26.1418929298208; Thu, 18 Dec 2014 11:01:38 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 11:01:37 -0800 (PST) In-Reply-To: <54931452.30000@yandex.ru> References: <86a92oddfp.fsf@yandex.ru> <86mw6nkc6n.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> <54931452.30000@yandex.ru> Date: Thu, 18 Dec 2014 17:01:37 -0200 X-Google-Sender-Auth: Ne8VGeq04lqV2AIGpOKba3JeSxg Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Sorry. The rest of the message was just babling anyway. I was just saying the performance hit of the current implementation is negligible when upgrading. Which is the same thing Stefan is saying. 2014-12-18 15:52 GMT-02:00 Dmitry Gutov : > On 12/18/2014 07:39 PM, Artur Malabarba wrote: > >> During package-initialize these things add up, so that's certainly a >> lot. But during a regular upgrade, what fraction of the total load time >> does that amount to? Even for large packages like helm I think this >> percentage should be small. But > > > ^^ > The message cuts off here. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 14:13:33 2014 Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 19:13:33 +0000 Received: from localhost ([127.0.0.1]:50544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1gVw-0007n7-Vo for submit@debbugs.gnu.org; Thu, 18 Dec 2014 14:13:33 -0500 Received: from mail-ob0-f169.google.com ([209.85.214.169]:48466) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1gVv-0007n0-OO for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 14:13:32 -0500 Received: by mail-ob0-f169.google.com with SMTP id vb8so4943967obc.0 for <19390@debbugs.gnu.org>; Thu, 18 Dec 2014 11:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=j/rk2QCIdHonEJ4y9OTuf/55mHqkYoGVX16MMewuWyk=; b=K2Co2IV9StDgydaENtLNTWoGVOyfffclcY06V2VgmOXIktV5DXeaBkSCzY2ETVhgBS 2LKdLR8M3hMKJi13f3Vpol89Yf/3AtNBWKky7E8TlLRAOD8/iAwCQx42H9G5CqD4XvhH OV+7U6m1I7d/xYDAk9SDRNH7itX5LViIR1bSpKSUeAMZr5Q8sb+T2k1Z1h2l/sDVehOE 4I2iLtyxoJhWeFse64K0B0qdYnMbpW3L6tJK3S5MBMsFl2P8uxp2HTqIE2S/kdAy6dib SKfJsQ6jc2hW5B8hoZjSKT8k63vlV9i+QpzwxNKcxxaoANLhPdFRND4AatYXB80S/kyv 6CoQ== MIME-Version: 1.0 X-Received: by 10.202.224.131 with SMTP id x125mr2160687oig.91.1418930011216; Thu, 18 Dec 2014 11:13:31 -0800 (PST) Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 11:13:31 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> <549314D7.8070106@yandex.ru> Date: Thu, 18 Dec 2014 17:13:31 -0200 X-Google-Sender-Auth: wTUeIPXm7205JyBt6-vilzd7HG4 Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2014-12-18 16:40 GMT-02:00 Stefan Monnier : >>> I don't think this performance hit will be noticeable during regular >>> package loading. >> It'll probably slow down Emacs startup: `require' will have to call >> `find-library-name' for each common feature that someone depends on, each >> time a dependant is loaded. > > And more importantly, we suffer the slow down when require is supposed to > be fast (i.e. when the package has already been loaded), so the relative > speed impact is not negligible. Again, is this slow down really that much? It is a single call to `find-library'. Yes, it is slow compared to the current speed of `require'ing an already loaded package, but is it slow in perspective with what else is being done? `require' is only ever called as part of loading package (or doing some other processing). Is a single call to `find-library' really that slow compared to the rest of the package that will be loaded (or byte-compiled) after this require? > > And doing it in `require' doesn't catch all cases, because it's done too > lazily and doesn't account for packages loaded via autoloads. Doing the > reloads eagerly when a package is (re)activated is the better choice. Yes, that's why I said we'd need to do something with `autoload's. Why do you think that's too high level? When `autoload' is called, if the function in question is completely defined (instead of not defined or just autoloaded), `autoload' will check if the file it was given is a different file from the one the function was defined in (when we know that file). If it is then all is fine, if it wasn't then it loads the new file. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 14:49:38 2014 Received: (at 19390-done) by debbugs.gnu.org; 18 Dec 2014 19:49:38 +0000 Received: from localhost ([127.0.0.1]:50565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1h4r-0000Gz-TC for submit@debbugs.gnu.org; Thu, 18 Dec 2014 14:49:38 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:56997) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1h4p-0000Gq-3s for 19390-done@debbugs.gnu.org; Thu, 18 Dec 2014 14:49:35 -0500 Received: by mail-wi0-f181.google.com with SMTP id r20so2988892wiv.14 for <19390-done@debbugs.gnu.org>; Thu, 18 Dec 2014 11:49:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=kFHjWxouMva82x6MwQicHcHINeAhrZTUzj7jJ/ttYBo=; b=NM+oIKYw//9ty2tR3tLpJUvPnucDzvemW6TmPLbMWub0ibbJqwPRsod1HEoG5Zg2yY EDIIw/2xlvLF4G/ovPN6w7Xkji/x7GuxPH9lqKfoD8KyE58L0cPsvAzo5vwDWI+Tw25s hmA49xqc0VgFfjUZsnA7bGX6n7ENDHFtdiMtd2a1HKMC7RQwUlZjmMC/KMgPUXOINugZ msfFxvyNEDfH3jCDicINFxHY9hfhdtCP475BQlUaRy1gGEkCLeZMR5D760d9aCBF6fVl ApPWymzPg9BhsHSQpulbHihJe1T+Pd5Yc9jMJ2iC7mfo1YRTtFSB6tM+1Y64mWb6XUs3 VsZA== X-Received: by 10.180.218.39 with SMTP id pd7mr8305530wic.21.1418932174302; Thu, 18 Dec 2014 11:49:34 -0800 (PST) Received: from [192.168.1.2] ([82.102.93.58]) by mx.google.com with ESMTPSA id iz19sm25935528wic.8.2014.12.18.11.49.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Dec 2014 11:49:33 -0800 (PST) Message-ID: <54932FC5.9090509@yandex.ru> Date: Thu, 18 Dec 2014 21:49:25 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: bruce.connor.am@gmail.com Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow References: <86a92oddfp.fsf@yandex.ru> <54904241.8010000@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <5492F68C.3090700@yandex.ru> <54931452.30000@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390-done Cc: Stefan Monnier , 19390-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 12/18/2014 09:01 PM, Artur Malabarba wrote: > Sorry. The rest of the message was just babling anyway. > I was just saying the performance hit of the current implementation is > negligible when upgrading. > Which is the same thing Stefan is saying. Oh well. I also wrote that my implementation is shorter and somewhat easier to read, but since no one else seems to think so, closing. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 18 23:31:34 2014 Received: (at 19390) by debbugs.gnu.org; 19 Dec 2014 04:31:34 +0000 Received: from localhost ([127.0.0.1]:50708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1pDy-0006DF-7Q for submit@debbugs.gnu.org; Thu, 18 Dec 2014 23:31:34 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:36294) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1pDv-0006D6-Ip for 19390@debbugs.gnu.org; Thu, 18 Dec 2014 23:31:32 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IPAS-Result: Aj8PAOwQflTO+ILA/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBAwFWIwULCw4mEhQYDSSISgnWWQEBAQEBAQQBAQEBHpBvB4RIBYsBjFUFl1SBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="102951564" Received: from 206-248-130-192.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Dec 2014 23:31:30 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 4A61B660DC; Thu, 18 Dec 2014 23:31:30 -0500 (EST) From: Stefan Monnier To: Artur Malabarba Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow Message-ID: References: <86a92oddfp.fsf@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> <549314D7.8070106@yandex.ru> Date: Thu, 18 Dec 2014 23:31:30 -0500 In-Reply-To: (Artur Malabarba's message of "Thu, 18 Dec 2014 17:13:31 -0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > `require' is only ever called as part of loading package (or doing > some other processing). There are a few places where we `require' inside a function that can be called repeatedly, on the assumption that in most cases, this `require' will be "instantaneous". I'd rather not re-consider this performance choice. I'm OK with slowing down require like you suggested (that was actually my original suggestion to handle the byte-compilation breakage during package upgrade), but then we'd only want to do it in some specific contexts (during byte-compilation) rather than all the time. > When `autoload' is called, if the function in question is completely > defined (instead of not defined or just autoloaded), `autoload' will > check if the file it was given is a different file from the one the > function was defined in (when we know that file). > If it is then all is fine, if it wasn't then it loads the new file. So we first add handling for `require', then another for `autoload', ... in the end I can't believe it can be simpler than what we have (which has 0 cost in normal use, and a very small extra cost during package upgrade). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 19 07:08:11 2014 Received: (at 19390) by debbugs.gnu.org; 19 Dec 2014 12:08:11 +0000 Received: from localhost ([127.0.0.1]:50872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1wLq-0004pB-TF for submit@debbugs.gnu.org; Fri, 19 Dec 2014 07:08:11 -0500 Received: from mail-oi0-f46.google.com ([209.85.218.46]:56375) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1wLp-0004oz-77 for 19390@debbugs.gnu.org; Fri, 19 Dec 2014 07:08:09 -0500 Received: by mail-oi0-f46.google.com with SMTP id h136so1322762oig.5 for <19390@debbugs.gnu.org>; Fri, 19 Dec 2014 04:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=aQB0HQqA6Xew7bX6PlQeuSatO6V2EBzuEw0mjQ4WEG4=; b=JfaOjUkBmO1YIQhZYEeEBQ1fSem63lT+eUsdZYKO34DJUtJl7CbKeSAj+K4WV0ZLDN JcOvBwHISw1b5LbaXPIjuNVg6CTAgC2KDOTLFXWUOUgwpKJya0jpiCNTiOSCajttWDGj oNyQpHZDb+myXYdM9jOJk7BlsooH84qeHNLTWqIJxW1eNQp3NMFJRCNnoN4PbqV7hIFo Frqhb2AZ0VFzMp5lKztBbo3YTe/uzoIQUon2YWt66J6xDfvPN4Y+5W62DoJ2vuGP4Siu 9SxhU6ez8sAp+Ay+oaK9y+dGfaHZSSzczmgmy+7FfTfaFoBqewcvRSAoWoVM5DNNTE4i 1GOg== MIME-Version: 1.0 X-Received: by 10.182.210.232 with SMTP id mx8mr4577049obc.46.1418990888774; Fri, 19 Dec 2014 04:08:08 -0800 (PST) Received: by 10.76.26.162 with HTTP; Fri, 19 Dec 2014 04:08:08 -0800 (PST) Received: by 10.76.26.162 with HTTP; Fri, 19 Dec 2014 04:08:08 -0800 (PST) In-Reply-To: References: <86a92oddfp.fsf@yandex.ru> <5490BFCD.5050505@yandex.ru> <5490ED6D.5080808@yandex.ru> <868ui5ervl.fsf@yandex.ru> <5492AE61.3040902@yandex.ru> <868ui5aubr.fsf@yandex.ru> <5492FDBD.1040704@yandex.ru> <549314D7.8070106@yandex.ru> Date: Fri, 19 Dec 2014 10:08:08 -0200 X-Google-Sender-Auth: E1KibqRu3ibwZVGkNNI19E7oA3s Message-ID: Subject: Re: bug#19390: 25.0.50; `package-activate' is too slow From: Artur Malabarba To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c2b12cdd72fc050a908ffe X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19390 Cc: 19390@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bruce.connor.am@gmail.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c2b12cdd72fc050a908ffe Content-Type: text/plain; charset=UTF-8 On 19 Dec 2014 02:31, "Stefan Monnier" wrote: > > > `require' is only ever called as part of loading package (or doing > > some other processing). > > There are a few places where we `require' inside a function that can be > called repeatedly, on the assumption that in most cases, this `require' > will be "instantaneous". I'd rather not re-consider this > performance choice. > > I'm OK with slowing down require like you suggested (that was actually > my original suggestion to handle the byte-compilation breakage during > package upgrade), but then we'd only want to do it in some specific > contexts (during byte-compilation) rather than all the time. > > > When `autoload' is called, if the function in question is completely > > defined (instead of not defined or just autoloaded), `autoload' will > > check if the file it was given is a different file from the one the > > function was defined in (when we know that file). > > If it is then all is fine, if it wasn't then it loads the new file. > > So we first add handling for `require', then another for `autoload', > ... in the end I can't believe it can be simpler than what we have > (which has 0 cost in normal use, and a very small extra cost during > package upgrade). In terms of lines of code, I think it would end up simpler, despite having to patch 3 functions instead of 1. Still, I understand it's too late now to be slowing down `require'. If there's code in Emacs core that relies on its speed, God knows how much code like that is floating around on the other Elpas or the wiki. Better stick with the version we have now. --001a11c2b12cdd72fc050a908ffe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 19 Dec 2014 02:31, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote= :
>
> > `require' is only ever called as part of loading package (or = doing
> > some other processing).
>
> There are a few places where we `require' inside a function that c= an be
> called repeatedly, on the assumption that in most cases, this `require= '
> will be "instantaneous".=C2=A0 I'd rather not re-conside= r this
> performance choice.
>
> I'm OK with slowing down require like you suggested (that was actu= ally
> my original suggestion to handle the byte-compilation breakage during<= br> > package upgrade), but then we'd only want to do it in some specifi= c
> contexts (during byte-compilation) rather than all the time.
>
> > When `autoload' is called, if the function in question is com= pletely
> > defined (instead of not defined or just autoloaded), `autoload= 9; will
> > check if the file it was given is a different file from the one t= he
> > function was defined in (when we know that file).
> > If it is then all is fine, if it wasn't then it loads the new= file.
>
> So we first add handling for `require', then another for `autoload= ',
> ... in the end I can't believe it can be simpler than what we have=
> (which has 0 cost in normal use, and a very small extra cost during > package upgrade).

In terms of lines of code, I think it would end up simpler, = despite having to patch 3 functions instead of 1. Still, I understand it= 9;s too late now to be slowing down `require'. If there's code in E= macs core that relies on its speed, God knows how much code like that is fl= oating around on the other Elpas or the wiki.

Better stick with the version we have now.

--001a11c2b12cdd72fc050a908ffe-- From unknown Sat Sep 06 14:23:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 16 Jan 2015 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator