From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: C and Emacs Lisp code parts Date: Fri, 01 Jul 2016 12:25:34 +0300 Message-ID: <83y45lu2up.fsf@gnu.org> References: <624c3d37-c829-7187-a699-7d7bbc211a20@online.de> <83ziq1u668.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1467365220 6500 80.91.229.3 (1 Jul 2016 09:27:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2016 09:27:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas =?utf-8?Q?R=C3=B6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 01 11:26:46 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bIuiV-00035k-IA for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2016 11:26:31 +0200 Original-Received: from localhost ([::1]:60634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIuiU-0000uq-PQ for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2016 05:26:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIuhx-0000u6-71 for emacs-devel@gnu.org; Fri, 01 Jul 2016 05:25:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIuht-00073n-5J for emacs-devel@gnu.org; Fri, 01 Jul 2016 05:25:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIuht-00073J-27; Fri, 01 Jul 2016 05:25:53 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1420 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bIuhq-00049X-Vu; Fri, 01 Jul 2016 05:25:51 -0400 In-reply-to: (message from Andreas =?utf-8?Q?R=C3=B6hler?= on Fri, 1 Jul 2016 10:39:26 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205025 Archived-At: > From: Andreas Röhler > Cc: Eli Zaretskii > Date: Fri, 1 Jul 2016 10:39:26 +0200 > > You need a number to believe function running from Emacs Lisp is slower > than an implementation in C? Any Emacs function implemented in C will be run by the Emacs Lisp interpreter, so the interpreter is always involved, whether you want it or not, and values need to be converted from their Lisp representation to the corresponding C representation. Against this background of Lisp interpreter calling functions implemented in C, a reimplementation in Lisp might not be significantly slower in practical use cases. Moreover, if the Lisp implementation uses a different algorithm, it could be even faster. And then there are functions whose speed doesn't matter at all, like functions which wait, or interface with slow external devices. So yes, we need numbers to make rational decisions about this.