performance measurements

Each table row shows performance measurements for this Lisp SBCL program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
50,0000.510.6332,480591  0% 2% 2% 98%
500,0004.844.85250,020591  1% 0% 1% 100%
5,000,000Timed Out  591   

Read the ↓ make, command line, and program output logs to see how this program was run.

Read regex-dna benchmark to see what this program should do.

 notes

This is SBCL 1.2.5, an implementation of ANSI Common Lisp.

 regex-dna Lisp SBCL program source code

;;; The Computer Language Benchmarks Game
;;; http://benchmarksgame.alioth.debian.org/
;;;
;;; contributed by Shyamal Prasad


(eval-when (:compile-toplevel :load-toplevel :execute)
  (require :asdf)
  (require :cl-ppcre))

(defparameter *regex-list*
  (list
   "agggtaaa|tttaccct"
   "[cgt]gggtaaa|tttaccc[acg]"
   "a[act]ggtaaa|tttacc[agt]t"
   "ag[act]gtaaa|tttac[agt]ct"
   "agg[act]taaa|ttta[agt]cct"
   "aggg[acg]aaa|ttt[cgt]ccct"
   "agggt[cgt]aa|tt[acg]accct"
   "agggta[cgt]a|t[acg]taccct"
   "agggtaa[cgt]|[acg]ttaccct"))

(defparameter *alternatives*
  '(("B" "(c|g|t)")  ("D" "(a|g|t)")
    ("H" "(a|c|t)")  ("K" "(g|t)")
    ("M" "(a|c)")    ("N" "(a|c|g|t)")
    ("R" "(a|g)")    ("S" "(c|t)")
    ("V" "(a|c|g)")  ("W" "(a|t)")
    ("Y" "(c|t)")))


;; Read in the entire file as the benchmark specifieds
(defun get-input-chars (stream)
  (with-output-to-string
    (output)
    (loop while (multiple-value-bind
		    (line missing) (read-line stream nil)
		  (when line (write-string line output))
		  (unless missing (write-char #\Newline output))
		  line))))
			 


(defun main (&optional (stream *standard-input*))
  (let*
      ;; Benchmark definition requires using a regex to
      ;; remove headers/newlines from the file
      ((text (get-input-chars stream))
       (sequence
	(cl-ppcre:regex-replace-all ">[^\\n]*\\n|\\n" text "")))

    ;; Count and print the number of subsequences
    (loop for regex in *regex-list* do
	  (format t "~a ~a~%" regex
		  (/ (length (cl-ppcre:all-matches regex sequence)) 2)))
    
    ;; Print lengths
    (format t "~%~a~%" (length text))
    (format t "~a~%" (length sequence))

    ;; do the alternative substitution and create the new text string
    ;; that the benchmark definition requires
    (loop for pair in *alternatives* do
	  (setf sequence
		(cl-ppcre:regex-replace-all (car pair) sequence (cadr pair))))
    (format t "~a~%" (length sequence))))

 make, command-line, and program output logs

Wed, 26 Nov 2014 01:07:46 GMT

MAKE:
cp: ‘regexdna.sbcl’ and ‘./regexdna.sbcl’ are the same file
SBCL built with: /usr/local/bin/sbcl --userinit /dev/null --batch --eval '(load "regexdna.sbcl_compile")'
### START regexdna.sbcl_compile
(handler-bind ((sb-ext:defconstant-uneql      (lambda (c) (abort c))))      (load (compile-file "regexdna.sbcl" ))) (save-lisp-and-die "sbcl.core" :purify t)
### END regexdna.sbcl_compile

; compiling file "/home/dunham/benchmarksgame/bench/regexdna/regexdna.sbcl" (written 24 JAN 2013 02:01:15 PM):
; compiling (REQUIRE :ASDF)
; compiling (REQUIRE :CL-PPCRE)
; compiling (DEFPARAMETER *REGEX-LIST* ...)
; compiling (DEFPARAMETER *ALTERNATIVES* ...)
; compiling (DEFUN GET-INPUT-CHARS ...)
; compiling (DEFUN MAIN ...)

; /home/dunham/benchmarksgame_onecore/regexdna/tmp/regexdna.fasl written
; compilation finished in 0:00:00.615
[undoing binding stack and other enclosing state... done]
[saving current Lisp image into sbcl.core:
writing 3496 bytes from the read-only space at 0x1000000
writing 2240 bytes from the static space at 0x1100000
writing 36638720 bytes from the dynamic space at 0x9000000
done]
### START regexdna.sbcl_run
(main) (quit)
### END regexdna.sbcl_run

1.72s to complete and log all make actions

COMMAND LINE:
/usr/local/bin/sbcl  --dynamic-space-size 1800 --noinform --core sbcl.core --userinit /dev/null --load regexdna.sbcl_run 0 < regexdna-input5000000.txt

TIMED OUT after 300s


PROGRAM OUTPUT:
agggtaaa|tttaccct 356
[cgt]gggtaaa|tttaccc[acg] 1250
a[act]ggtaaa|tttacc[agt]t 4252
ag[act]gtaaa|tttac[agt]ct 2894
agg[act]taaa|ttta[agt]cct 5435
aggg[acg]aaa|ttt[cgt]ccct 1537
agggt[cgt]aa|tt[acg]accct 1431
agggta[cgt]a|t[acg]taccct 1608
agggtaa[cgt]|[acg]ttaccct 2178

50833411
50000000

Heap exhausted during allocation: 72802304 bytes available, 80001016 requested.
 Gen StaPg UbSta LaSta LUbSt Boxed Unboxed LB   LUB  !move  Alloc  Waste   Trig    WP  GCs Mem-age
   0: 59913     0     0     0 18231     1     0 19532  9769 154431768 249576 113288784    0   1  0.0000
   1:  8962  8961     0     0  2264     2     0 169924 150399 705253272 36968 395332448 2257   1  0.5338
   2: 15491 15489     0     0  3403    23     0 195618 164916 815200752 83472  2000000 3383   0  0.0000
   3:     0     0     0     0     0     0     0     0     0        0     0  2000000    0   0  0.0000
   4:     0     0     0     0     0     0     0     0     0        0     0  2000000    0   0  0.0000
   5:     0     0     0     0     0     0     0     0     0        0     0  2000000    0   0  0.0000
   6:     0     0     0     0  7098  1847     0     0     0 36638720     0  2000000 7033   0  0.0000
   Total bytes allocated    = 1711524512
   Dynamic-space-size bytes = 1887436800
GC control variables:
   *GC-INHIBIT* = false
   *GC-PENDING* = false
   *STOP-FOR-GC-PENDING* = false

debugger invoked on a SB-KERNEL::HEAP-EXHAUSTED-ERROR in thread
#<THREAD "main thread" RUNNING {B2F6501}>:
  Heap exhausted (no more space for allocation).
There are still 72802304 bytes available; the request was for 80001016 bytes.

PROCEED WITH CAUTION.

Revised BSD license

  Home   Conclusions   License   Play