tests.lisp 10.5 KB
Newer Older
Eric Marsden's avatar
Eric Marsden committed
1 2
;;; all the performance benchmarks
;;;
3
;;; Time-stamp: <2016-05-13 19:48:31 jack>
Eric Marsden's avatar
Eric Marsden committed
4 5 6 7 8 9 10 11 12 13


(in-package :cl-bench)


(defbench compiler
    :group :misc
    :function 'cl-bench.misc:run-compiler
    :long "Compilation of the Gabriel benchmarks"
    :runs 3
14
    :disabled-for '(:gcl :armedbear))
Eric Marsden's avatar
Eric Marsden committed
15 16 17 18 19

(defbench load-fasl
    :group :misc
    :function 'cl-bench.misc:run-fasload
    :runs 20
20
    :disabled-for '(:gcl :armedbear))
Eric Marsden's avatar
Eric Marsden committed
21 22 23 24 25 26

(defbench sum-permutations
    :group :misc
    :long "traversal of a large, linked, self-sharing structure"
    :function 'cl-bench.misc:run-permutations
    :runs 2
27
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
28 29 30 31 32 33 34

(defbench walk-list/seq
    :group :misc
    :long "Walk a list of 2M fixnums that were sequentially allocated"
    :setup 'cl-bench.misc::setup-walk-list/seq
    :function 'cl-bench.misc:walk-list/seq
    :runs 2
35
    :disabled-for '(:lispworks-personal-edition :armedbear :allegro-cl-express :ecl-bytecmp))
Eric Marsden's avatar
Eric Marsden committed
36 37 38 39 40 41 42

(defbench walk-list/mess
    :group :misc
    :long "Walk a list of 2M fixnums that were mergesorted to spread pointers"
    :setup 'cl-bench.misc::setup-walk-list/mess
    :function 'cl-bench.misc:walk-list/mess
    :runs 1
43
    :disabled-for '(:lispworks-personal-edition :armedbear :poplog :allegro-cl-express :clasp :ecl-bytecmp))
Eric Marsden's avatar
Eric Marsden committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180

(defbench boyer
  :group :gabriel
  :function 'cl-bench.gabriel:boyer
  :long "CONS-intensive logic-programming code"
  :runs 30)

(defbench browse
  :group :gabriel
  :function 'cl-bench.gabriel:browse
  :runs 10)

(defbench dderiv
  :group :gabriel
  :function 'cl-bench.gabriel:dderiv-run
  :runs 50)

(defbench deriv
  :group :gabriel
  :function 'cl-bench.gabriel:deriv-run
  :runs 60)

(defbench destructive
  :group :gabriel
  :function 'cl-bench.gabriel:run-destructive
  :runs 100)

(defbench div2-test-1
  :group :gabriel
  :function 'cl-bench.gabriel:run-div2-test1
  :runs 200)

(defbench div2-test-2
  :group :gabriel
  :function 'cl-bench.gabriel:run-div2-test2
  :runs 200)

(defbench fft
  :group :gabriel
  :function 'cl-bench.gabriel:run-fft
  :runs 30)

(defbench frpoly/fixnum
  :group :gabriel
  :function 'cl-bench.gabriel:run-frpoly/fixnum
  :runs 100)

(defbench frpoly/bignum
  :group :gabriel
  :function 'cl-bench.gabriel:run-frpoly/bignum
  :runs 30)

(defbench frpoly/float
  :group :gabriel
  :function 'cl-bench.gabriel:run-frpoly/float
  :runs 100)

(defbench puzzle
  :group :gabriel
  :long "Forest Baskett's Puzzle, exercising simple-vectors"
  :function 'cl-bench.gabriel:run-puzzle
  :runs 1500)

(defbench tak
  :group :gabriel
  :function 'cl-bench.gabriel:run-tak
  :runs 500)

(defbench ctak
    :group :gabriel
    :long "TAKeuchi function using the catch/throw facility"
    :function 'cl-bench.gabriel:run-ctak
    :runs 900)

(defbench trtak
    :group :gabriel
    :long "TAKeuchi function without tail recursion"
    :function 'cl-bench.gabriel:run-trtak
    :runs 500)

(defbench takl
    :group :gabriel
    :long "TAKeuchi function with lists as counters"
    :function 'cl-bench.gabriel:run-takl
    :runs 150)

(defbench stak
    :group :gabriel
    :long "TAKeuchi function with special variables instead of parameter passing"
    :function 'cl-bench.gabriel:run-stak
    :runs 200)

(defbench fprint/ugly
    :group :gabriel
    :long "Pretty-printer and write operations to file, no *PRINT-PRETTY*"
    :function 'cl-bench.gabriel:fprint/ugly
    :runs 200)

(defbench fprint/pretty
    :group :gabriel
    :long "Pretty-printer and write operations to file, with *PRINT-PRETTY*"
    :function 'cl-bench.gabriel:fprint/pretty
    :runs 100)

(defbench traverse
  :group :gabriel
  :long "Creates and traverses a tree structure"
  :function 'cl-bench.gabriel:run-traverse
  :runs 15)

(defbench triangle
  :group :gabriel
  :long "Puzzle solving (board game) using combinatorial search"
  :function 'cl-bench.gabriel:run-triangle
  :runs 5)

;; end of Gabriel benchmarks

(defbench richards
    :group :misc
    :long "Operating system simulation"
    :function 'cl-bench.richards:richards
    :runs 5)

(defbench factorial
    :group :math
    :function 'cl-bench.math:run-factorial
    :runs 1000)

(defbench fib
    :group :math
    :function 'cl-bench.math:run-fib
    :runs 50)

(defbench fib-ratio
    :group :math
    :function 'cl-bench.math:run-fib-ratio
Karsten Poeck's avatar
Karsten Poeck committed
181
    :runs 500
Daniel Kochmański's avatar
Daniel Kochmański committed
182
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
183 184 185 186 187

(defbench ackermann
    :group :math
    :long "Calculating Ackermann's number (heavy recursion)"
    :function 'cl-bench.math:run-ackermann
188 189
    :runs 1
    :disabled-for '(:clisp))
Eric Marsden's avatar
Eric Marsden committed
190 191 192 193 194

(defbench mandelbrot/complex
    :group :math
    :long "Mandelbrot Set computation using complex numbers"
    :function 'cl-bench.math:run-mandelbrot/complex
Karsten Poeck's avatar
Karsten Poeck committed
195 196
    :runs 100
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251

(defbench mandelbrot/dfloat
    :group :math
    :long "Mandelbrot Set computation using double-floats"
    :function 'cl-bench.math:run-mandelbrot/dfloat
    :runs 100)

(defbench mrg32k3a
    :group :math
    :long "multiple recursive random number generator of l'Ecuyer"
    :function 'cl-bench.math:run-mrg32k3a
    :runs 20)

(defbench crc40
    :group :math
    :long "Cyclic redundancy check calculation using 40-bit integers"
    :function 'cl-bench.crc:run-crc40
    :runs 2)

(defbench bignum/elem-100-1000
    :group :bignum
    :function 'cl-bench.bignum:run-elem-100-1000
    :runs 1)

(defbench bignum/elem-1000-100
    :group :bignum
    :function 'cl-bench.bignum:run-elem-1000-100
    :runs 1)

(defbench bignum/elem-10000-1
    :group :bignum
    :function 'cl-bench.bignum:run-elem-10000-1
    :runs 1)

(defbench bignum/pari-100-10
    :group :bignum
    :function 'cl-bench.bignum:run-pari-100-10
    :runs 1)

(defbench bignum/pari-200-5
    :group :bignum
    :function 'cl-bench.bignum:run-pari-200-5
    :runs 1)

;; this one takes ages to run
#+slow-tests
(defbench bignum/pari-1000-1
    :group :bignum
    :short "bignum/pari-1000-1"
    :function 'cl-bench.bignum:run-pari-1000-1
    :runs 1)

(defbench pi-decimal/small
    :group :bignum
    :function 'cl-bench.bignum:run-pi-decimal/small
Karsten Poeck's avatar
Karsten Poeck committed
252 253
    :runs 100
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
254 255 256 257

(defbench pi-decimal/big
    :group :bignum
    :function 'cl-bench.bignum:run-pi-decimal/big
Karsten Poeck's avatar
Karsten Poeck committed
258 259
    :runs 2
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
260 261 262 263

(defbench pi-atan
    :group :bignum
    :function 'cl-bench.bignum:run-pi-atan
Karsten Poeck's avatar
Karsten Poeck committed
264 265
    :runs 200
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
266 267 268 269

(defbench pi-ratios
    :group :bignum
    :function 'cl-bench.ratios:run-pi-ratios
Karsten Poeck's avatar
Karsten Poeck committed
270 271
    :runs 2
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292

(defbench hash-strings
    :group :hash
    :function 'cl-bench.hash:hash-strings
    :runs 2)

(defbench hash-integers
    :group :hash
    :function 'cl-bench.hash:hash-integers
    :runs 10)

(defbench slurp-lines
    :group :gc
    :long "Line-by-line read of a large file (mostly testing allocation speed)"
    :function 'cl-bench.hash:run-slurp-lines
    :runs 30)

(defbench boehm-gc
    :group :gc
    :function 'cl-bench.boehm-gc:gc-benchmark
    :runs 1
293
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
294 295 296 297

(defbench deflate-file
    :group :misc
    :function 'cl-bench.deflate:run-deflate-file
Karsten Poeck's avatar
Karsten Poeck committed
298 299
    :runs 100
    :disabled-for '(:clasp))
Eric Marsden's avatar
Eric Marsden committed
300 301 302 303 304 305 306

;; these tests exceed the limited stack size in the trial version of LW
(defbench 1d-arrays
    :group :sequence
    :long "Adding together two vectors"
    :function 'cl-bench.arrays:bench-1d-arrays
    :runs 1
307
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
308 309 310 311 312 313

(defbench 2d-arrays
    :group :sequence
    :long "Adding together two 2-dimensional arrays"
    :function 'cl-bench.arrays:bench-2d-arrays
    :runs 1
314
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
315 316 317 318 319 320

(defbench 3d-arrays
    :group :sequence
    :long "Adding together two 3-dimensional arrays"
    :function 'cl-bench.arrays:bench-3d-arrays
    :runs 1
Daniel Kochmański's avatar
Daniel Kochmański committed
321
    :disabled-for '(:lispworks-personal-edition :allegro-cl-express))
Eric Marsden's avatar
Eric Marsden committed
322 323 324 325 326 327 328

;; Poplog seems to have a buggy implementation of bitvectors
(defbench bitvectors
    :group :sequence
    :long "BIT-XOR, BIT-AND on big bitvectors"
    :function 'cl-bench.arrays:bench-bitvectors
    :runs 3
Daniel Kochmański's avatar
Daniel Kochmański committed
329
    :disabled-form '(:lispworks-personal-edition :poplog))
Eric Marsden's avatar
Eric Marsden committed
330 331 332 333 334 335

(defbench bench-strings
    :group :sequence
    :long "Allocate and fill large strings"
    :function 'cl-bench.arrays:bench-strings
    :runs 1
336
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
337 338 339 340 341 342 343

(defbench fill-strings/adjust
    :group :sequence
    :short "fill-strings/adjustable"
    :long "Fill an adjustable array with characters"
    :function 'cl-bench.arrays:bench-strings/adjustable
    :runs 1
344
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
345 346 347 348 349 350 351 352 353

;; as of 2002-01-20 this crashes CLISP, both release and CVS versions.
;; It exceeds maximum array size for both Allegro CL and LispWorks.
;; It takes AGES and consumes around 120MB RSS with Poplog
(defbench string-concat
    :group :sequence
    :long "WITH-OUTPUT-TO-STRING and much output"
    :function 'cl-bench.arrays:bench-string-concat
    :runs 1
Karsten Poeck's avatar
Karsten Poeck committed
354
    :disabled-for '(:allegro :lispworks-personal-edition :poplog :clisp))
Eric Marsden's avatar
Eric Marsden committed
355 356 357 358 359 360

(defbench search-sequence
    :group :sequence
    :long "FIND, FIND-IF, POSITION on a simple-vector"
    :function 'cl-bench.arrays:bench-search-sequence
    :runs 1
361
    :disabled-for '(:lispworks-personal-edition))
Eric Marsden's avatar
Eric Marsden committed
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410

(defbench clos-defclass
    :group :clos
    :short "CLOS/defclass"
    :long "Defines a class hierarchy"
    :function 'cl-bench.clos:run-defclass
    :runs 1)

(defbench clos-defmethod
    :group :clos
    :short "CLOS/defmethod"
    :long "Defines methods on the class hierarchy"
    :function 'cl-bench.clos:run-defmethod
    :runs 1)

(defbench clos-instantiate
    :group :clos
    :short "CLOS/instantiate"
    :long "Instantiates a complicated class hierarchy"
    :function 'cl-bench.clos:make-instances
    :runs 2)

(defbench clos-instantiate
    :group :clos
    :short "CLOS/simple-instantiate"
    :long "Instantiates a simple class hierarchy"
    :function 'cl-bench.clos:make-instances/simple
    :runs 200)

(defbench methodcalls
    :group :clos
    :short "CLOS/methodcalls"
    :long "Make method calls against the created instances."
    :function 'cl-bench.clos:methodcalls/simple
    :runs 5)

(defbench methodcalls+after
    :group :clos
    :short "CLOS/method+after"
    :long "Define after methods on our instances, then run some method calls"
    :function 'cl-bench.clos:methodcalls/simple+after
    :runs 2)

(defbench methodcalls/complex
    :group :clos
    :short "CLOS/complex-methods"
    :long "Run methodcalls with and method combination."
    :function 'cl-bench.clos:methodcalls/complex
    :runs 5
411
    :disabled-for '(:clisp :poplog))
Eric Marsden's avatar
Eric Marsden committed
412 413 414 415 416 417 418 419

(defbench eql-specialized-fib
    :group :clos
    :long "Fibonnaci function implemented with EQL specialization"
    :function 'cl-bench.clos:run-eql-fib
    :runs 2)

;; EOF