From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.help Subject: Re: Why is Elisp slow? Date: Tue, 7 May 2019 15:14:42 +0200 Message-ID: <20190507131442.7hnyuqpknzldorur@Ergus> References: <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; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="90788"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: help-gnu-emacs@gnu.org, =?utf-8?B?7KGw7ISx67mI?= To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 07 15:15:24 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 1hNzwI-000NTt-8s for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 15:15:22 +0200 Original-Received: from localhost ([127.0.0.1]:46680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzwH-0000rK-7u for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 09:15:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzvq-0000e2-7Q for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:14:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNzvp-0000wK-Be for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:14:54 -0400 Original-Received: from sonic314-19.consmr.mail.ir2.yahoo.com ([77.238.177.145]:34364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNzvo-0000vK-RJ for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:14:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1557234889; bh=pZzdD0xSQVfvRs60jvF6gGuysDvugOH293q8tEid0TA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=RbZOsReQNekah4CMkit6AXc5w+3Ymz4CR3oKxNxfAk3jtNH/kBRYPR+LBUjQLUCV5jfqMwGe2MqjkbYRwCoF7cp2SI13uuQLWz2vYzklwLY+4oG14k3EnJPKFfABXzDPhwzzJ/9vAr0DZVMc5i1iD10BDU7PzmQ/3ItNzG5pjkYUSTpiaPuBUnr0DVV4xHvl8ZOscGmb3+O48P77MfmF9on3jbq4G26XzF9OMLTYiYlKz/9lDXJh6PZxmq8zcGvMKrwYuOfuIIoVeCfJIs46PehA4Jmm4taFM4ONzsgqUuirChGDLOZa7rkB1+H1YYJlHYdD/cqaBTqwh7BSl/643Q== X-YMail-OSG: jGrPEPkVM1kgj_ux5XiG1zVgvahUxZrLpyMdd2NMRiK.e1v_0i4oYDu0HjYhFvt GZWuXu9MYzPrAWP5sSmvn6rh6urutf7lC4h_CBVnZVtM3zEHqiMEGc0810zNQbjmAhPG7WifKkEd IAbsBJYxow8.zkhb9ZWPDrOuhj8q8o3IB7F676RhKdTNsOXLFFMyX3Sds_mZCjW.Y.9lzgN_iZTI MZVzWORefgBmVdzW0__RxM5Cqh3jHOrh8FVk2yd54aCMkhKIXktFoE8skBcxBd_10crcPgGu1FAn mtR9iVxxkF9v5OqeDhxR_YUJkwA3zoZZFopdbaLobiggKij2vQuIzIfWBvHm2qiO82WG3wi5tPTu tb.JsXvhKVm3W.7Vh9XBdQybly.XfdDplzlePiTdmJ3J56M2YLXQXvF9SfN4MFWMPHs6m8NGMkMp E7L.8YfQVQVfiXgJqb97ju.H6b3cwE_I00zsMmDMMnQVC6MY68u3dC9W9nBNxhy6NGpTpKBOmG2K 34oErIQeQqDpvbHpsDp_XklPP0YHe8XJFfRHl_.Cskyd0qHsbWCzt1W9K4uNLkiaQNxdYzX0FhuP ._6TOkPeZfPcqWnI9N4wl7FVEz.hKru709Ty3NUo8I58UqLgXtTgSpvTmVF2JrT9dhR.ueA5eBVB ogPuoyI_OYlAPOc4fIu4I226rukNDF0BSOStfFztcFxgbI0ebbun8bOBI1LrvKa6kmNWSCZdDOFT UDJXC8Ei0wBaDmO0fPQPmdIlMzoFIvZDYPtzWJ3GWZeSg1Gxpl.n5.06QpX64fXrS2uuhBydsVn9 wssUsEGb9XCgP5AtdhqBaLTj6potzWmdvyHl3fv6pu Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Tue, 7 May 2019 13:14:49 +0000 Original-Received: from 2.152.205.184.dyn.user.ono.com (EHLO Ergus) ([2.152.205.184]) by smtp417.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6f9dd73c9ddf504b805d9409fce41b17; Tue, 07 May 2019 13:14:45 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.177.145 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:120255 Archived-At: On Tue, May 07, 2019 at 09:04:31AM -0400, Stefan Monnier wrote: >>> 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???s 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. > > The optional argument ALL-FRAMES specifies the frames to consider: > > - t means consider all windows on all existing frames. > > - `visible' means consider all windows on all visible frames. > > - 0 (the number zero) means consider all windows on all visible > and iconified frames. > > - A frame means consider all windows on that frame only. > > 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; > > if (NILP (buffer_or_name)) > buffer = Fcurrent_buffer (); > else > buffer = Fget_buffer (buffer_or_name); > > if (BUFFERP (buffer)) > return window_loop (GET_BUFFER_WINDOW, buffer, true, all_frames); > else > return Qnil; > } > > >-- Stefan > That's why I was wondering about the C binds and the C types representations in SBCL more than the lisp part of the implementation.