From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How does one find out what file a library has been loaded from? Date: Tue, 19 Jul 2022 18:50:00 +0300 Message-ID: <83sfmxm79z.fsf@gnu.org> References: <83bktlnuog.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24204"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 19 17:50:58 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDpUw-00063h-62 for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Jul 2022 17:50:58 +0200 Original-Received: from localhost ([::1]:44186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDpUu-0005rv-FV for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Jul 2022 11:50:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpUB-000570-V5 for emacs-devel@gnu.org; Tue, 19 Jul 2022 11:50:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpUB-0007Un-2c; Tue, 19 Jul 2022 11:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qpGBqEvulxF98kQ0T2pBbnYmebd23tXYSJQ0M1dg9J8=; b=YfffhPz0KbZj fRYDENXfddtSoSMKB6NFk27mNcGDBNtoQGdJa9P99kD8Nc8IG9+L7KF3dUihMBUxxsyEzacMLZm+p H8jVDE2/N4XkGCXlUCIVDFyj1r1Y1cnC/DX+YUtLwJhUI9FOWwePxhEFWj0v/rUmcfbWG44mUVlMg tjeo0KYDEKou/ifWLwgPKDTzheflWodK0Af5o3i/3mstAPIAqXUTpFBkyhwvK6Qz6j3xKGWWz6tbH A5ePljmtZOTmF2zKyfIEkyxwgRwjTN6cvyIxM36gsW1CzI6VUoOFXkHamLL1E6iI7dEBsX15LipbZ x4rRjfPnLaCpCma3M8lfOw==; Original-Received: from [87.69.77.57] (port=4195 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDpUA-0000uJ-IT; Tue, 19 Jul 2022 11:50:10 -0400 In-Reply-To: (message from Alan Mackenzie on Tue, 19 Jul 2022 15:01:12 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292277 Archived-At: > Date: Tue, 19 Jul 2022 15:01:12 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > What do you like to find? whether it was loaded from cc-engine.elc or > > cc-engine-XXXXXX.eln? > > Exactly that, yes. > > > If so, why does it matter? > > It matters a great deal. There's the purely philosophical point that one > should be able to control and understand ones own Emacs. I didn't major in philosophy, so I cannot help you here, sorry. > A further point is that Emacs should not deceive its users. It doesn't. > There's the point that if you're doing benchmark timings, the results are > meaningless if you don't know what you're timing. You are timing compiled Lisp code. How exactly was it compiled shouldn't matter _in_principle_, exactly as you don't have any easy way of knowing what version of byte-compiler and byte-optimizer was used to produce a .elc file -- and the differences can be significant. If you do need to make this kind of distinctions, you have to use "different means". Like disassembly of the byte-code or looking if cc-engine-XXXXXX.eln file is in your eln-cache, or using "C-h f" on some function from cc-engine, where Emacs will tell you whether it's byte-compiled ot natively-compiled (you can also use subr-native-elisp-p directly if you want).