1 ;;; cl-profs.el -- Benchmarks for CL
2 ;; Copyright (C) 2006, 2007 Sebastian Freundt
4 ;; Author: Sebastian Freundt <hroptatyr@sxemacs.org>
7 ;; This file is part of SXEmacs.
9 ;; Redistribution and use in source and binary forms, with or without
10 ;; modification, are permitted provided that the following conditions
13 ;; 1. Redistributions of source code must retain the above copyright
14 ;; notice, this list of conditions and the following disclaimer.
16 ;; 2. Redistributions in binary form must reproduce the above copyright
17 ;; notice, this list of conditions and the following disclaimer in the
18 ;; documentation and/or other materials provided with the distribution.
20 ;; 3. Neither the name of the author nor the names of any contributors
21 ;; may be used to endorse or promote products derived from this
22 ;; software without specific prior written permission.
24 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
25 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 ;;; Synched up with: Not in FSF.
39 ;; See benchmark.el for instructions on how to run these tests.
45 (when (and (boundp 'load-file-name) (stringp load-file-name))
46 (push (expand-file-name "../tests/benchmark"
47 (file-name-directory load-file-name))
49 (require 'benchmark)))
54 (defun cl:loop-for (N)
56 (cl:loop for i below N))
58 (defun cl:loop-count (N)
60 (cl:loop for i below N
64 "lisp for-arith clause"
73 ;; now the actual test suites
76 :test-funv [cl:loop-for cl:loop-count]
77 :test-range '(10 . 1000000)
78 :plot-file "benchmark-C-loop.plot"))
82 :test-funv [loop-for loop-count]
83 :test-range '(10 . 1000000)
84 :plot-file "benchmark-lisp-loop.plot"))
86 ;; cl-loop-profs.el ends here