unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: 14892@debbugs.gnu.org
Subject: bug#14892: [PATCH] Enhance Elisp compare functions (< <= > >=) to take var args
Date: Tue, 10 Sep 2013 09:20:48 -0400	[thread overview]
Message-ID: <jwva9jk95xl.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAFM41H3zQhOmQf6Ufngh54A0R7wwHNpE97u-7Bt4aUw73sTrGg@mail.gmail.com> (Barry OReilly's message of "Mon, 9 Sep 2013 18:53:27 -0400")

Looking at your patch a second time, I don't see how/where it handles
(< a b c) in byte-compiled code: the byte-codes only handle 2-arguments,
and the byte-compiler is left unchanged.

>> Do you have some performance numbers?
> Let arithcompare-benchmark.el contain:
>   (defun arithcompare-many (lhs rhs)
>     (dotimes (_ (floor 1e6))
>       (< lhs rhs)))
>   (message "%s" (benchmark-run 1 (arithcompare-many 100 101)))
> Run by:
>   emacs -Q --batch -f batch-byte-compile arithcompare-benchmark.el && emacs
> -Q --batch --load arithcompare-benchmark.elc
> The results averaged over ten trials each:
>   Before patch: (0.061 0 0.0)
>   After patch: (0.084 0 0.0)

The slowdown is not too bad, but I think it'd be better to change the
implementation so that the bytecode.c code is left mostly unchanged
(i.e. calling a function that only handles 2 arguments), so that there's
no slowdown at all.
IOW, change bytecode.c to call "arithcompare (TOP, v1, grtr)" rather
than the previous "Fgtr (TOP, v1)" or the new "Fgtr (2, &TOP)".


        Stefan





  reply	other threads:[~2013-09-10 13:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 15:58 bug#14892: Enhance Elisp compare functions (< <= > >=) to take var args Barry OReilly
2013-09-06 23:02 ` bug#14892: [PATCH] " Barry OReilly
2013-09-07  2:28   ` Stefan Monnier
2013-09-09 22:53     ` Barry OReilly
2013-09-10 13:20       ` Stefan Monnier [this message]
2013-09-10 14:54         ` Barry OReilly
2013-09-10 20:16           ` Stefan Monnier
2013-09-10 23:35             ` Barry OReilly
2013-09-11  1:08               ` Stefan Monnier
2013-09-11  5:10                 ` Barry OReilly
2013-09-11 12:33                   ` Stefan Monnier

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=jwva9jk95xl.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14892@debbugs.gnu.org \
    --cc=gundaetiapo@gmail.com \
    /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).