[Top][All Lists]
[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
- Re: [PATCH] use tail pointer for LOOP (Was: Re: O(N^2) behavior in LOOP), tomas, 2010/06/16
- Re: [PATCH] use tail pointer for LOOP, David Kastrup, 2010/06/16
- Re: [PATCH] use tail pointer for LOOP, tomas, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, Thien-Thi Nguyen, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, tomas, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, Thien-Thi Nguyen, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, tomas, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, Thien-Thi Nguyen, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP,
Thien-Thi Nguyen <=
- Re: [PATCH] use tail pointer for LOOP, Stefan Monnier, 2010/06/17
- Re: [PATCH] use tail pointer for LOOP, David Kastrup, 2010/06/18
- Re: [PATCH] use tail pointer for LOOP, Stefan Monnier, 2010/06/18