From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: VIRT_ADDR_VARIES Date: Mon, 07 Nov 2011 15:23:16 -0800 Organization: UCLA Computer Science Department Message-ID: <4EB86864.5080709@cs.ucla.edu> References: <4EB73983.1060000@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1320708217 11275 80.91.229.12 (7 Nov 2011 23:23:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 23:23:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 08 00:23:34 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RNYXJ-0000Ux-2I for ged-emacs-devel@m.gmane.org; Tue, 08 Nov 2011 00:23:29 +0100 Original-Received: from localhost ([::1]:58457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNYXH-0004Of-W0 for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2011 18:23:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNYXF-0004Oa-5C for emacs-devel@gnu.org; Mon, 07 Nov 2011 18:23:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNYXD-00016d-Uz for emacs-devel@gnu.org; Mon, 07 Nov 2011 18:23:25 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:41514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNYXD-00016Y-Og for emacs-devel@gnu.org; Mon, 07 Nov 2011 18:23:23 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 772EB39E800A; Mon, 7 Nov 2011 15:23:21 -0800 (PST) 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 1Qqht3vvmI4F; Mon, 7 Nov 2011 15:23:21 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 02B6C39E8007; Mon, 7 Nov 2011 15:23:21 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145934 Archived-At: On 11/07/11 00:38, Andreas Schwab wrote: > Paul Eggert writes: >> I expect the main reason is performance. > > How much of it matters? Compiling without VIRT_ADDR_VARIES speeds up aset by 44% on my host (Fedora 15 x86-64, GCC 4.6.2, AMD Phenom II X4 910e). Benchmark code is shown below; I ran (benchmark 100000000) five times on the byte-compiled version of this code, and took the median. >> for Emacs it shouldn't matter whether PURE_P checks >> accurately or loosely -- either way Emacs should operate correctly. > > Which it doesn't. Sorry, I don't know the context. What's the bug here? If Emacs doesn't define VIRT_ADDR_VARIES when it should, then that can cause bugs -- is that the issue? Here's the benchmark code. (defun benchmark-with-aset (n) (let ((start (float-time (get-internal-run-time))) (v (make-vector 1 0)) (i 0)) (while (< i n) (aset v 0 1) (setq i (1+ i))) (- (float-time (get-internal-run-time)) start))) (defun benchmark-without-aset (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-aset n) (benchmark-without-aset n)))