From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Optimising Elisp code Date: Fri, 05 Oct 2018 19:23:29 +0200 Organization: Aioe.org NNTP Server Message-ID: <86d0so48a6.fsf@zoho.com> References: <638fb7dc-6fc5-4645-8793-97a00038a3a8@googlegroups.com> <86r2h44fqg.fsf@zoho.com> <86in2g4eq6.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1538760207 19194 195.159.176.226 (5 Oct 2018 17:23:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2018 17:23:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) 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 19:23:22 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 1g8Tow-0004u6-QL for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Oct 2018 19:23:22 +0200 Original-Received: from localhost ([::1]:36236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Tr3-0003XI-Az for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Oct 2018 13:25:33 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: xQsFb8j6c/kdg9AvIrnVFA.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org Mail-Copies-To: never X-Notice: Filtered by postfilter v. 0.8.3 Cancel-Lock: sha1:2zp7iA3WrsbgCCzOQD/MqfO/1PQ= Original-Xref: usenet.stanford.edu gnu.emacs.help:224003 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:118129 Archived-At: Óscar Fuentes wrote: > Emanuel Berg writes: > >> OK, in C++ it works like this: If a member >> function is defined within the class >> definition (not recommended), or if it is >> defined outside of it (recommended) with the >> word "inline" preceding the return type, >> then the function becomes an inline >> function. What this means is that when the >> code is compiled into machine code, instead >> of having one place for the function, and >> jumping back and forth every time that >> function is called, the machine code for the >> inline function is placed, duplicated >> wherever it is used. So you get longer >> machine code, but faster, since there is >> just constant execution for the inline >> functions, without jumping back and forth. >> When should it be used? If the function is >> very short, say 1-3 lines, the jumping back >> and forth requires more machine instructions >> than the function itself. Then the >> organizational gain of having it neatly at >> one place is diminished by the speed >> advantage of not having to jump back and >> forth to that place all the time. > > Just in case any bystander finds this post: > don't rely on anything that is mentioned > above, nor for C++ `inline' keyword nor for > code inlining in general. I read it in this book: @book{cpp-direkt, author = {Jan Skansholm}, ISBN = {91-44-47931-X}, publisher = {Studentlitteratur}, title = {C++ direkt}, year = {1996} } -- underground experts united http://user.it.uu.se/~embe8573