unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Is byte-compiled code supposed to call `make-byte-code'?
Date: Wed, 25 May 2016 10:13:28 -0400	[thread overview]
Message-ID: <jwvposauteq.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAG7BpapgJwoufDM89Ton9PcjfRTQOX09ERbCWGVdJss93r59MQ@mail.gmail.com

>> But it isn't a constant, it depends on the function's argument.
> You are right, didn't think about it. However, given that it is a
> repetetive process, shouldn't all constant parts of it be moved to C
> level instead of bytecode, as an optimization?

When Emacs-24.1 introduced lexical-binding, the focus was on:
- preserving backward compatibility.
- minimizing the amount of code changed.
- providing correct semantics.
- no speed regression.

IOW performance of lexically scoped code was not on the agenda.

Notice that the problem in the code you quote is not just the amount of
byte-code, but also in the closure that's generated: whether we hide it
inside a new "make-closure" bytecode or not, the construction of the new
closure object is more costly than in most "standard" representation
of closures (which normally only involves construction of one object,
rather than two).

So, yes, there's a fair bit of room for improvement (and not just in
this one particular spot).


        Stefan




      reply	other threads:[~2016-05-25 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 20:58 Is byte-compiled code supposed to call `make-byte-code'? Paul Pogonyshev
2016-05-24 21:19 ` Andreas Schwab
2016-05-25  8:53   ` Paul Pogonyshev
2016-05-25 14:13     ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvposauteq.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).