emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] use tail pointer for LOOP


From: Thien-Thi Nguyen
Subject: Re: [PATCH] use tail pointer for LOOP
Date: Thu, 17 Jun 2010 12:12:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

() address@hidden
() Thu, 17 Jun 2010 11:22:32 +0200

Oops, i didn't look at this carefully before:

   (defun do-benchmark (n)
     (let ((lst))
       (while (> n 0)
         (setq lst (cons n lst)
               n (1- n)))
       (garbage-collect)
       (message (concat "copy1: %S\n"
                        "copy2: %S\n"
                        "copy3: %S\n")
               (benchmark-run (copy1 lst))
               (benchmark-run (copy2 lst))
               (benchmark-run (copy3 lst)))))

Probably for more meaningful results, you should ‘garbage-collect’
prior to each ‘benchmark-run’.  Otherwise, each run is disadvantaged
(less memory "easily" available) with respect to its predecessor.
A standard benchmarking principle (useful in other disciplines, too)
is to eliminate these differences.

thi



reply via email to

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