From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Why is Elisp slow? Date: Tue, 07 May 2019 09:04:31 -0400 Message-ID: References: <831BD780-F954-4E23-BF31-ED4E135C919B@icloud.com> <20190506125848.okei2qrib7m5p3vx@Ergus> <20190506161757.wg4wy3vr7emxnciv@Ergus> <443E6AB4-2478-4677-8A23-A0B04559E949@icloud.com> <84F2860D-523D-4F30-BD52-D6A915416167@icloud.com> <20190507104945.gfdrftaeztrzbkt6@Ergus> <44A389B2-9D9D-4C1F-B9E3-9859C77DAF70@icloud.com> <798C9A13-7A2F-4C43-A5D9-6FDE00D647FC@icloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="43115"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Ergus , help-gnu-emacs@gnu.org To: =?utf-8?B?7KGw7ISx67mI?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 07 15:04:48 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNzm4-000B1c-C5 for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 15:04:48 +0200 Original-Received: from localhost ([127.0.0.1]:46565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzm3-00054y-Dc for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 09:04:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzlt-00054o-TJ for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:04:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNzls-0003JM-VR for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:04:37 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzls-0003Ih-Qd for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:04:36 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x47D4Wor022164; Tue, 7 May 2019 09:04:32 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 1066C66184; Tue, 7 May 2019 09:04:32 -0400 (EDT) In-Reply-To: <798C9A13-7A2F-4C43-A5D9-6FDE00D647FC@icloud.com> (=?utf-8?B?IuyhsOyEseu5iCIncw==?= message of "Tue, 7 May 2019 22:01:12 +0900") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6540=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6540> : inlines <7074> : streams <1820833> : uri <2841561> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:120254 Archived-At: >> Similarly, you'll need to rewrite all the functions/macros like CONSP, >> SYMBOLP, FIXNUMP, XCAR, XCDR, make_fixnum, ... Performance of those >> is important. > > Why would you not use the default CL=E2=80=99s defun, car, cdr, symbol-p, > cons-p, etc, etc? I'm talking the work needed to adapt Emacs's C code, e.g: DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, = 2, 0, doc: /* Return a window currently displaying BUFFER-OR-NAME, or = nil if none. BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the current buffer. =20=20=20=20 The optional argument ALL-FRAMES specifies the frames to consider: =20=20=20=20 - t means consider all windows on all existing frames. =20=20=20=20 - `visible' means consider all windows on all visible frames. =20=20=20=20 - 0 (the number zero) means consider all windows on all visible and iconified frames. =20=20=20=20 - A frame means consider all windows on that frame only. =20=20=20=20 Any other value of ALL-FRAMES means consider all windows on the selected frame and no others. */) (Lisp_Object buffer_or_name, Lisp_Object all_frames) { Lisp_Object buffer; =20=20=20=20 if (NILP (buffer_or_name)) buffer =3D Fcurrent_buffer (); else buffer =3D Fget_buffer (buffer_or_name); =20=20=20=20 if (BUFFERP (buffer)) return window_loop (GET_BUFFER_WINDOW, buffer, true, all_frames); else return Qnil; } -- Stefan