From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Optimising Elisp code Date: Fri, 5 Oct 2018 12:03:08 +0200 Message-ID: <20181005100308.GE4139@tuxteam.de> References: <638fb7dc-6fc5-4645-8793-97a00038a3a8@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" X-Trace: blaine.gmane.org 1538733705 23814 195.159.176.226 (5 Oct 2018 10:01:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2018 10:01:45 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 05 12:01:41 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8MvT-00064v-5F for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Oct 2018 12:01:39 +0200 Original-Received: from localhost ([::1]:34324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8MxZ-0002Wu-MI for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Oct 2018 06:03:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Mx3-0002Wk-8H for help-gnu-emacs@gnu.org; Fri, 05 Oct 2018 06:03:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8Mwx-0002tl-3O for help-gnu-emacs@gnu.org; Fri, 05 Oct 2018 06:03:14 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:50541) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8Mww-0002rP-MO for help-gnu-emacs@gnu.org; Fri, 05 Oct 2018 06:03:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=1osbL9SLqYpFX6b7ZnDU8jRaHkueIK7VzzYS0UOXnGI=; b=nio2i5bW2hcbhT1lwlD5Ll6+iPvZWAk0q/86UXMYQhUAl5IarBCcwoivLvf1HdkzdyQTi+f1FaPPWG8rqaHXb2PqTydGwYKVjBzYX0eW9BrYONJilsQ+ysoirQgbGp8ZUVHOTn7k1EYRV8HgJoo9Liob4Z9tg318eojIVXrbJOt9bbUue+mBoONftMSAMmSvR2jrwpWZOCC6obuGOtfX2LmgHepY1Z/Ab4u36JBiMxgUUSej7ZIFMc0SedQD+oTFMpQshjuDBSB7vLmICd9OUU3182vOEjquY3f5h/SrdtVFIXHzrcxYlXVZVUc1/mcb+5iffxmpr4R3a6LMzE8QMQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1g8Mwu-0002BV-SB for help-gnu-emacs@gnu.org; Fri, 05 Oct 2018 12:03:08 +0200 Content-Disposition: inline In-Reply-To: <638fb7dc-6fc5-4645-8793-97a00038a3a8@googlegroups.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118122 Archived-At: --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 04, 2018 at 07:15:30PM -0700, Davin Pearson wrote: > Suppose that you have a function: >=20 > (defun foo () > (bar)) >=20 > And bar is a function that has no side effects and returns 123 then calli= ng > the function code-optimize (the name of my optimisation routine) >=20 > M-x code-optimize on the function foo will result in the following defun= =20 >=20 > (defun foo () > 123) Have you already looked at the code produced by the elisp compiler? As in doing "compile-function" and "disassemble-function"? Have you had a look at eval-and-compile and friends? Perhaps elisp is already doing (parts of) what you have in mind? Cheers -- tom=C3=A1s --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlu3NtwACgkQBcgs9XrR2kbFWACfYQ8xOiKBa9qCR9KAkD3l4BIC 3ikAn17/w2sLhfXbdSq2Xt2lpS+mQWTz =1L/f -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4--