emacs-devel
[Top][All Lists]
Advanced

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

Re: VIRT_ADDR_VARIES


From: Paul Eggert
Subject: Re: VIRT_ADDR_VARIES
Date: Mon, 07 Nov 2011 15:23:16 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0

On 11/07/11 00:38, Andreas Schwab wrote:
> Paul Eggert <address@hidden> 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)))



reply via email to

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