From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14892: [PATCH] Enhance Elisp compare functions (< <= > >=) to take var args Date: Tue, 10 Sep 2013 09:20:48 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1378819340 11506 80.91.229.3 (10 Sep 2013 13:22:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2013 13:22:20 +0000 (UTC) Cc: 14892@debbugs.gnu.org To: Barry OReilly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 10 15:22:22 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VJNtd-0006Q1-IV for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Sep 2013 15:22:21 +0200 Original-Received: from localhost ([::1]:57875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJNtd-000898-1v for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Sep 2013 09:22:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJNtS-00087x-48 for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2013 09:22:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJNtK-00025R-Qi for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2013 09:22:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJNtK-00025N-NY for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2013 09:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VJNtK-0000LY-1c for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2013 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Sep 2013 13:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14892-submit@debbugs.gnu.org id=B14892.13788192831282 (code B ref 14892); Tue, 10 Sep 2013 13:22:01 +0000 Original-Received: (at 14892) by debbugs.gnu.org; 10 Sep 2013 13:21:23 +0000 Original-Received: from localhost ([127.0.0.1]:52170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJNsf-0000Kb-L9 for submit@debbugs.gnu.org; Tue, 10 Sep 2013 09:21:22 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:54486) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJNsY-0000KM-O2 for 14892@debbugs.gnu.org; Tue, 10 Sep 2013 09:21:19 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r8ADLDJp030068; Tue, 10 Sep 2013 09:21:13 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 4A78AB40D3; Tue, 10 Sep 2013 09:20:49 -0400 (EDT) In-Reply-To: (Barry OReilly's message of "Mon, 9 Sep 2013 18:53:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4697=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4697> : inlines <79> : streams <1034919> : uri <1532664> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78168 Archived-At: 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