[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14892: [PATCH] Enhance Elisp compare functions (< <= > >=) to take v

From: Stefan Monnier
Subject: bug#14892: [PATCH] Enhance Elisp compare functions (< <= > >=) to take var args
Date: Tue, 10 Sep 2013 09:20:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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)".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]