mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
tests/mass_elements.gnuplot: gnuplot file for the mass_elements benchmark. Run as gnuplot mass_elements.gnuplot > foo...
Original commit message from CVS: 2005-02-24 Andy Wingo <wingo@pobox.com> * tests/mass_elements.gnuplot: gnuplot file for the mass_elements benchmark. Run as gnuplot mass_elements.gnuplot > foo.ps, after running bench-mass_elements.scm. * tests/bench-mass_elements.scm: New script, runs mass_elements for various numbers of identities, outputting the results to a file. Requires guile 1.6. Just for testing.
This commit is contained in:
parent
b02973d212
commit
bffcaf6e70
5 changed files with 156 additions and 0 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2005-02-24 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* tests/mass_elements.gnuplot: gnuplot file for the mass_elements
|
||||
benchmark. Run as gnuplot mass_elements.gnuplot > foo.ps, after
|
||||
running bench-mass_elements.scm.
|
||||
|
||||
* tests/bench-mass_elements.scm: New script, runs mass_elements
|
||||
for various numbers of identities, outputting the results to a
|
||||
file. Requires guile 1.6. Just for testing.
|
||||
|
||||
2005-02-23 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/schedulers/fairscheduler.c:
|
||||
|
|
2
tests/.gitignore
vendored
2
tests/.gitignore
vendored
|
@ -42,3 +42,5 @@ spidey_bench
|
|||
*.bb
|
||||
*.bbg
|
||||
*.da
|
||||
*.data
|
||||
*.ps
|
||||
|
|
68
tests/bench-mass_elements.scm
Executable file
68
tests/bench-mass_elements.scm
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/bin/bash
|
||||
# -*- scheme -*-
|
||||
exec guile -s $0 "$@"
|
||||
!#
|
||||
|
||||
;; Quick hack to make some data files that gnuplot can read from
|
||||
;; mass-elements. Guile 1.6.
|
||||
|
||||
(use-modules (srfi srfi-13)
|
||||
(srfi srfi-1)
|
||||
(ice-9 optargs)
|
||||
(ice-9 popen))
|
||||
|
||||
(define *phases* '(create set run destroy))
|
||||
|
||||
(define (read-lines port)
|
||||
(let lp ((lines '()))
|
||||
(let ((x (read-line port)))
|
||||
(if (eof-object? x)
|
||||
(begin
|
||||
(close-port port)
|
||||
(reverse! lines))
|
||||
(lp (cons x lines))))))
|
||||
|
||||
(define (run-test n-identities)
|
||||
(format #t "; running test: ~a\n" n-identities)
|
||||
(let lp ((in (read-lines
|
||||
(open-input-pipe
|
||||
(format #f "./mass_elements ~A"
|
||||
(number->string n-identities)))))
|
||||
(out '()))
|
||||
(if (null? in)
|
||||
(begin
|
||||
(or (eq? (length out) 4) (error "Invalid mass_elements output"))
|
||||
(map cons *phases* (reverse! out)))
|
||||
(let ((line (car in)))
|
||||
(if (eqv? (string-ref line 0) #\*)
|
||||
(lp (cdr in) out)
|
||||
(lp (cdr in)
|
||||
(cons (fold (lambda (x ret) (+ (* ret 60) x)) 0
|
||||
(map (lambda (x) (with-input-from-string x read))
|
||||
(string-split line #\:)))
|
||||
out)))))))
|
||||
|
||||
(define (run-tests start stop step)
|
||||
(let lp ((n start) (out '()))
|
||||
(if (> n stop)
|
||||
(reverse! out)
|
||||
(lp (+ n step)
|
||||
(acons n (run-test n) out)))))
|
||||
|
||||
(define (output-results results)
|
||||
(let ((p (open-output-file "mass_elements.data")))
|
||||
(display "#num_identities creation state-change run destroy\n" p)
|
||||
(let lp ((in results))
|
||||
(if (not (null? in))
|
||||
(let* ((line (car in))
|
||||
(n (car line)))
|
||||
(display n p)
|
||||
(for-each
|
||||
(lambda (t) (format p " ~a" t))
|
||||
(map cdr (cdr line)))
|
||||
(newline p)
|
||||
(lp (cdr in)))))
|
||||
(close-port p)))
|
||||
|
||||
(output-results
|
||||
(apply run-tests (map string->number (cdr (program-arguments)))))
|
8
tests/benchmarks/mass-elements.gnuplot
Normal file
8
tests/benchmarks/mass-elements.gnuplot
Normal file
|
@ -0,0 +1,8 @@
|
|||
set terminal postscript landscape monochrome dashed "Helvetica" 14
|
||||
set xlabel "Number of Identity Elements"
|
||||
set ylabel "Seconds"
|
||||
set title "Mass Pipeline Performance: fakesrc ! N * identity ! fakesink"
|
||||
plot "mass_elements.data" using 1:2 title "Element creation", \
|
||||
"mass_elements.data" using 1:3 title "State change", \
|
||||
"mass_elements.data" using 1:4 title "Processing 1000 buffers", \
|
||||
"mass_elements.data" using 1:5 title "Element destruction"
|
68
tests/benchmarks/mass-elements.scm
Executable file
68
tests/benchmarks/mass-elements.scm
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/bin/bash
|
||||
# -*- scheme -*-
|
||||
exec guile -s $0 "$@"
|
||||
!#
|
||||
|
||||
;; Quick hack to make some data files that gnuplot can read from
|
||||
;; mass-elements. Guile 1.6.
|
||||
|
||||
(use-modules (srfi srfi-13)
|
||||
(srfi srfi-1)
|
||||
(ice-9 optargs)
|
||||
(ice-9 popen))
|
||||
|
||||
(define *phases* '(create set run destroy))
|
||||
|
||||
(define (read-lines port)
|
||||
(let lp ((lines '()))
|
||||
(let ((x (read-line port)))
|
||||
(if (eof-object? x)
|
||||
(begin
|
||||
(close-port port)
|
||||
(reverse! lines))
|
||||
(lp (cons x lines))))))
|
||||
|
||||
(define (run-test n-identities)
|
||||
(format #t "; running test: ~a\n" n-identities)
|
||||
(let lp ((in (read-lines
|
||||
(open-input-pipe
|
||||
(format #f "./mass_elements ~A"
|
||||
(number->string n-identities)))))
|
||||
(out '()))
|
||||
(if (null? in)
|
||||
(begin
|
||||
(or (eq? (length out) 4) (error "Invalid mass_elements output"))
|
||||
(map cons *phases* (reverse! out)))
|
||||
(let ((line (car in)))
|
||||
(if (eqv? (string-ref line 0) #\*)
|
||||
(lp (cdr in) out)
|
||||
(lp (cdr in)
|
||||
(cons (fold (lambda (x ret) (+ (* ret 60) x)) 0
|
||||
(map (lambda (x) (with-input-from-string x read))
|
||||
(string-split line #\:)))
|
||||
out)))))))
|
||||
|
||||
(define (run-tests start stop step)
|
||||
(let lp ((n start) (out '()))
|
||||
(if (> n stop)
|
||||
(reverse! out)
|
||||
(lp (+ n step)
|
||||
(acons n (run-test n) out)))))
|
||||
|
||||
(define (output-results results)
|
||||
(let ((p (open-output-file "mass_elements.data")))
|
||||
(display "#num_identities creation state-change run destroy\n" p)
|
||||
(let lp ((in results))
|
||||
(if (not (null? in))
|
||||
(let* ((line (car in))
|
||||
(n (car line)))
|
||||
(display n p)
|
||||
(for-each
|
||||
(lambda (t) (format p " ~a" t))
|
||||
(map cdr (cdr line)))
|
||||
(newline p)
|
||||
(lp (cdr in)))))
|
||||
(close-port p)))
|
||||
|
||||
(output-results
|
||||
(apply run-tests (map string->number (cdr (program-arguments)))))
|
Loading…
Reference in a new issue