From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#11935: XINT etc. should be functions Date: Sun, 15 Jul 2012 06:41:41 -0700 Organization: UCLA Computer Science Department Message-ID: <5002C895.4080400@cs.ucla.edu> References: <500039B7.8050106@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342359740 32275 80.91.229.3 (15 Jul 2012 13:42:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 15 Jul 2012 13:42:20 +0000 (UTC) Cc: 11935@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 15 15:42:20 2012 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 1SqP5W-00088D-81 for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jul 2012 15:42:18 +0200 Original-Received: from localhost ([::1]:35956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqP5V-000518-K8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jul 2012 09:42:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqP5S-000510-Ee for bug-gnu-emacs@gnu.org; Sun, 15 Jul 2012 09:42:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqP5R-0005ll-GJ for bug-gnu-emacs@gnu.org; Sun, 15 Jul 2012 09:42:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqP5R-0005lh-Cg for bug-gnu-emacs@gnu.org; Sun, 15 Jul 2012 09:42:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SqPB3-00036x-Vm for bug-gnu-emacs@gnu.org; Sun, 15 Jul 2012 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jul 2012 13:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 11935-submit@debbugs.gnu.org id=B11935.134236004111909 (code B ref 11935); Sun, 15 Jul 2012 13:48:01 +0000 Original-Received: (at 11935) by debbugs.gnu.org; 15 Jul 2012 13:47:21 +0000 Original-Received: from localhost ([127.0.0.1]:42615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqPAP-000362-4N for submit@debbugs.gnu.org; Sun, 15 Jul 2012 09:47:21 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:35680) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqPAN-00035u-29 for 11935@debbugs.gnu.org; Sun, 15 Jul 2012 09:47:20 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 94150A60001; Sun, 15 Jul 2012 06:41:29 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZFNZt2CJD5kA; Sun, 15 Jul 2012 06:41:28 -0700 (PDT) Original-Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id ADA9A39E8008; Sun, 15 Jul 2012 06:41:28 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61956 Archived-At: On 07/13/2012 07:20 PM, Richard Stallman wrote: > How does this change affect performance with -O0? It hurts it. In normal operation I don't notice -- everything is plenty fast enough -- but in an artificial benchmark designed to stress the new code (see below) the performance is significantly worse. If this is an issue, we can mark these new functions with __attribute__ ((__always_inline__)), but I'm inclined to try things without this attribute, and resort to the attribute only if needed. I did two measures of performance. "text" simply counts the number of bytes in the text segment. "bench" counts the number of CPU seconds consumed by running the benchmark described below. "current" refers to trunk bzr 109093, and "patched" to that bzr after the proposed patch is applied. In both cases I've normalized the numbers to the current default (so it scores as 1), and smaller numbers are better. text bench 1.000 1.00 current (default optimization) 0.995 0.99 patched (default optimization) 1.332 1.82 current (-O0) 1.410 11.86 patched (-O0) My benchmark was (benchmark 100000), with the following code, byte-compiled. My platform is Fedora 15 x86-64, compiled with GCC 4.7.1. Benchmark timings are sloppy, as usual, so I wouldn't attach much significance past the first couple of digits. (defvar longlist '(a b c d e f g h i j k l m n o p q r s t u v w x y z)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (setq longlist (append longlist longlist)) (defvar x) (defun benchmark-with (n) (let ((start (float-time (get-internal-run-time))) (v (make-vector 1 0)) (i 0)) (while (< i n) (setq x (nth 8000 longlist)) (setq i (1+ i))) (- (float-time (get-internal-run-time)) start))) (defun benchmark-without (n) (let ((start (float-time (get-internal-run-time))) (v (make-vector 1 0)) (i 0)) (while (< i n) (setq i (1+ i))) (- (float-time (get-internal-run-time)) start))) (defun benchmark (n) (- (benchmark-with n) (benchmark-without n)))