From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?7KGw7ISx67mI?= Newsgroups: gmane.emacs.help Subject: Re: Why is Elisp slow? Date: Tue, 7 May 2019 22:43:24 +0900 Message-ID: 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> <20190507131442.7hnyuqpknzldorur@Ergus> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) 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="222225"; mail-complaints-to="usenet@blaine.gmane.org" Cc: help-gnu-emacs@gnu.org, Stefan Monnier To: Ergus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 07 15:43:54 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 1hO0Nu-000vaU-2L for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 15:43:54 +0200 Original-Received: from localhost ([127.0.0.1]:47054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO0Ns-0004Oo-UJ for geh-help-gnu-emacs@m.gmane.org; Tue, 07 May 2019 09:43:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO0Nb-0004Od-7v for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:43:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO0Na-0005EV-9q for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:43:35 -0400 Original-Received: from pv50p00im-ztdg10021801.me.com ([17.58.6.56]:37454) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO0Na-0005Dg-11 for help-gnu-emacs@gnu.org; Tue, 07 May 2019 09:43:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1557236612; bh=iPYVDxhmAC5686IPgTWleTUo5ZSKFq62XasLQYwgct4=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=uy8fHuS0fjG0O4JB9599onW6SFatEH4qoKTlfSDv3zJOIf4MANyhtpT/MMbIwUjP5 BiXwYnU9CapMQzBh/1I0iN+OjoOdw+eolY0HcoOixsnGSetNtY0fIgvlaIeDNkp1mY gAiDVZQieiM1bIR/vQezOY0+SvohGyVfDTF/I1VobHGpWEk2e7v9O4u21qlA2xo9Xh 8UrsPqCP6YFdvY8X9FxDNB62FWPhpGkGbchTozd20CAicBic0VINbRko1jZvzs7v/9 yVomV1c8+9EXXeIZrTXCFEKh1WSEjNNKb5KWu1PxnCemgivJxYoRjDOqOp6TjRUBbn tmBXCvUvhk9wg== Original-Received: from 172.20.nate.com (unknown [223.38.24.127]) by pv50p00im-ztdg10021801.me.com (Postfix) with ESMTPSA id 3A8593606C1; Tue, 7 May 2019 13:43:29 +0000 (UTC) In-Reply-To: <20190507131442.7hnyuqpknzldorur@Ergus> X-Mailer: Apple Mail (2.3445.9.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-07_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=647 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1905070090 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 17.58.6.56 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:120258 Archived-At: Thinking about this, instead of SBCL (which is super-fast, but imposes = restrictions on functions being called from the outside world), why not = embed ECL (Embeddable Common Lisp), which=20 * is significantly slower than SBCL, about 2~3x slower? but is still = much faster than Elisp. * compiles CL code to C * has great interoperability with C (have never done this before :-( but = based on what I hear, can both freely call CL functions from C and the = other way around, generate C inside CL as a ECL extension, etc, etc=E2=80=A6= ) Looks like if Emacs code has Elisp & C interwined, ECL might be a better = shot? > 2019. 5. 7. =EC=98=A4=ED=9B=84 10:14, Ergus =EC=9E=91= =EC=84=B1: >=20 > 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. >>>=20 >>> Why would you not use the default CL???s defun, car, cdr, symbol-p, >>> cons-p, etc, etc? >>=20 >> I'm talking the work needed to adapt Emacs's C code, e.g: >>=20 >> 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 >> The optional argument ALL-FRAMES specifies the frames to consider: >>=20 >> - t means consider all windows on all existing frames. >>=20 >> - `visible' means consider all windows on all visible frames. >>=20 >> - 0 (the number zero) means consider all windows on all visible >> and iconified frames. >>=20 >> - A frame means consider all windows on that frame only. >>=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 >> if (NILP (buffer_or_name)) >> buffer =3D Fcurrent_buffer (); >> else >> buffer =3D Fget_buffer (buffer_or_name); >>=20 >> if (BUFFERP (buffer)) >> return window_loop (GET_BUFFER_WINDOW, buffer, true, = all_frames); >> else >> return Qnil; >> } >>=20 >>=20 >> -- Stefan >>=20 > 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.