From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#19390: 25.0.50; `package-activate' is too slow Date: Thu, 18 Dec 2014 17:13:31 -0200 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> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1418930067 11406 80.91.229.3 (18 Dec 2014 19:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2014 19:14:27 +0000 (UTC) Cc: 19390@debbugs.gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 18 20:14:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y1gWf-0003vq-0q for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Dec 2014 20:14:17 +0100 Original-Received: from localhost ([::1]:55473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1gWe-0003E3-AU for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Dec 2014 14:14:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1gWW-00039G-44 for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 14:14:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1gWQ-0000WR-S2 for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 14:14:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1gWQ-0000W9-PV for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 14:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y1gWQ-0007nw-IB for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 14:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Dec 2014 19:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19390 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19390-submit@debbugs.gnu.org id=B19390.141893001329959 (code B ref 19390); Thu, 18 Dec 2014 19:14:02 +0000 Original-Received: (at 19390) by debbugs.gnu.org; 18 Dec 2014 19:13:33 +0000 Original-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 Original-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 Original-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== X-Received: by 10.202.224.131 with SMTP id x125mr2160687oig.91.1418930011216; Thu, 18 Dec 2014 11:13:31 -0800 (PST) Original-Received: by 10.76.26.162 with HTTP; Thu, 18 Dec 2014 11:13:31 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: wTUeIPXm7205JyBt6-vilzd7HG4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97546 Archived-At: 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.