From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.help Subject: Native compilation by default?: Was [Re: stats say SBCL is 78 875 % faster than natively compiled Elisp Date: Tue, 21 Feb 2023 12:34:21 +0530 Message-ID: References: <87bklw7ka3.fsf@dataswamp.org> <878rgyjgcc.fsf@dataswamp.org> <87o7pq21i4.fsf@dataswamp.org> <87ilfy20jf.fsf@dataswamp.org> <83pma6yahj.fsf@gnu.org> <87fsb21z1n.fsf@dataswamp.org> <83ilfyxiw6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18675"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:sOtgd7bX68GEJ+aBgnXsseVQ6Hw= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 21 08:04:24 2023 Return-path: Envelope-to: geh-help-gnu-emacs@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 1pUMhM-0004jV-1L for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 21 Feb 2023 08:04:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUMgr-0006zM-QY; Tue, 21 Feb 2023 02:03:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUMgp-0006zA-1r for help-gnu-emacs@gnu.org; Tue, 21 Feb 2023 02:03:51 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUMgn-0001aM-FQ for help-gnu-emacs@gnu.org; Tue, 21 Feb 2023 02:03:50 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pUMgj-0003ln-ML for help-gnu-emacs@gnu.org; Tue, 21 Feb 2023 08:03:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142793 Archived-At: pardon the blog -- to test the validity of the claims in this thread I was trying to run ``` (time (fib 2000 500)) (time (slynk::eval-in-emacs '(fib 5000 500))) ``` from within some lisp to compare the elapsed time. However when I tried to "native" compile Emanuel Berg's fib function in a file fib.el ``` ;; -*- lexical-binding: t -*- (defun fib (reps num) (let ((z 0)) (dotimes (_ reps) (let ((p1 1) (p2 1)) (dotimes (_ (- num 2)) (setf z (+ p1 p2) p2 p1 p1 z)))) z)) ``` with (byte-compile-file "fib.el" t) I got a fib.elc which was loaded, but the file was not natively compiled. (dissassemble 'fib) only shows the byte code. I was under the impression that this should have automatically produced an eln file with default native-* variables which i've reviewed. I was able to produce the eln file with an explicit call to ``` (load (native-compile "fib.el")) or M-x emacs-lisp-native-compile-and-load ``` and load it and dissassemble it Is my understanding of the documentation - that native compilation is an automatic side effect of byte compiling, wrong? Last tried on the `master' branch with sources from around 2023-02-15