From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: master 289000e: Merge branch 'feature/native-comp' into trunk Date: Mon, 26 Apr 2021 13:21:25 +0000 Message-ID: References: <20210425182503.25223.81072@vcs0.savannah.gnu.org> <20210425182508.6CC7C2094D@vcs0.savannah.gnu.org> <831rayktot.fsf@gnu.org> <83v989jmuc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10460"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, akrl@sdf.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 26 15:22:10 2021 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 1lb1Bh-0002PD-C8 for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Apr 2021 15:22:09 +0200 Original-Received: from localhost ([::1]:56948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lb1Bg-0001ZV-AT for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Apr 2021 09:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lb1B5-00018V-Cx for emacs-devel@gnu.org; Mon, 26 Apr 2021 09:21:31 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:35225 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1lb1B2-0004fp-Me for emacs-devel@gnu.org; Mon, 26 Apr 2021 09:21:31 -0400 Original-Received: (qmail 9351 invoked by uid 3782); 26 Apr 2021 13:21:26 -0000 Original-Received: from acm.muc.de (p4fe15c82.dip0.t-ipconnect.de [79.225.92.130]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 26 Apr 2021 15:21:26 +0200 Original-Received: (qmail 7146 invoked by uid 1000); 26 Apr 2021 13:21:25 -0000 Content-Disposition: inline In-Reply-To: <83v989jmuc.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:268467 Archived-At: Hello, Eli. On Mon, Apr 26, 2021 at 14:40:11 +0300, Eli Zaretskii wrote: > > Date: Sun, 25 Apr 2021 21:55:29 +0000 > > Cc: akrl@sdf.org, emacs-devel@gnu.org > > From: Alan Mackenzie > > > > What else do I need to know, successfully to build and run the > > > > native compilation feature? > > > Hopefully, nothing (just to build and run). > > This is sadly far from true. You need to know basic things like native > > compile files are .eln. You need to know how to compile files. I > > guessed that > > $ emacs -Q -batch -f batch-native-compile lisp/progmodes/cc-*.el > > would natively compile CC Mode. > You originally said nothing about compiling any Lisp files, let alone > measuring the performance of CC Mode as result of native-compilation. > The answer I gave specifically said "just to build and run". OK, fair enough! ;-) > Indeed, for your purpose, one needs to do more. > > Well, it took several minutes of processing in which it did > > something, but I don't know what. A find failed to find > > '*cc-*.eln'. > I believe they should be under your ~/.emacs.d/eln-cache/ directory. They are indeed there, yes. Thanks. > > On restarting Emacs, my favourite CC Mode benchmark was only > > marginally (~4%) faster. > I'm guessing that you didn't compile everything you need natively. It > is quite hard to determine "by hand" which Lisp files will be needed, > as CC Mode files use Lisp code from many other files, and they all > need to be natively-compiled to see the full benefits. > My suggestion is to load and run the code you want to benchmark, but > after the benchmark finishes, leave Emacs running until 'ps' no longer > shows inferior Emacs processes run in the background -- those are the > subprocesses Emacs starts to natively-compile every .el file your > program loads. Once all the native-compilation subprocesses exit, > exit your interactive session, and then run the benchmark again; this > time it should show the full speedup of native-compilation. I've tried that, but I don't think the native compile versions of CC Mode got loaded. If they had been loaded, there would have been _some_ speed up. What I did was, in essence, M-: (load-file "~/emacs/emacs.git/master/lisp/progmodes/cc-defs.elc") (but from a Lisp script), repeated ~thirteen times for each CC Mode file. This didn't seem to load the corresponding cc-defs-....eln, etc. Should it? If not, what is the canonical way to load a set of .eln files? Do I have to give the exact .eln file names in the load-file calls? Or, am I forced to tweak load-path to load a specific natively compiled version of CC Mode? How do I know when a .eln file has been loaded? > > I'm frustrated at the moment. I want to use this new feature, but don't > > know how to, and can't find any documentation. "native compilation" > > doesn't seem to appear in either the Emacs or the Elisp manual. > We have a lot to do in the documentation department for this feature. > You can wait until we are done (which could take a while), or you > could ask questions (but in the latter case please be more specific, > so that the answers are useful for you). Sorry, I got the impression that, with the merge, the feature was almost ready for full time use in Emacs. Maybe I should be patient and wait a little longer. Thanks for the help! -- Alan Mackenzie (Nuremberg, Germany).