Changeset 39363 in project


Ignore:
Timestamp:
11/24/20 02:08:03 (8 weeks ago)
Author:
Kon Lovett
Message:

fix overhead calc, count overhead, O5 except block & clustering

Location:
release/5/micro-benchmark/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/micro-benchmark/trunk/micro-benchmark.egg

    r39344 r39363  
    11((synopsis "easily create micro-benchmarks")
    2  (version "0.0.1")
     2 (version "0.0.2")
    33 (author "David Krentzlin")
    44 (maintainer "[[kon lovett]]")
     
    1212    (cond-expand
    1313      (linux
    14         (csc-options "-lrt" "-O3" "-d1" "-strict-types" "-no-procedure-checks-for-toplevel-bindings"))
     14        (csc-options "-lrt" "-O4" "-d0" "-disable-interrupts" "-strict-types" "-no-procedure-checks-for-toplevel-bindings"))
    1515      (else
    16         (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks-for-toplevel-bindings")) ) ) ) )
     16        (csc-options "-O4" "-d0" "-disable-interrupts" "-strict-types" "-no-procedure-checks-for-toplevel-bindings")) ) ) ) )
  • release/5/micro-benchmark/trunk/micro-benchmark.scm

    r39356 r39363  
    297297;;
    298298
     299;any overhead
     300(define *iterations-overhead* 0.0)
     301;calc any overhead
     302(define-constant OVERHEAD-ITERATIONS 10000000)
     303(let ((before (*realtime-microsecs)))
     304  (dotimes (_ OVERHEAD-ITERATIONS) (void))
     305  (set! *iterations-overhead* (/ OVERHEAD-ITERATIONS (- (*realtime-microsecs) before))) )
     306
    299307;@seconds # of seconds
    300308;@warmups # of seconds
     
    307315      ((per-100ms _) (iterations-per-100ms thunk (secs->ms warmups)))
    308316      ((threshold) (+ (*realtime-microsecs) (secs->ÎŒs seconds))) )
    309       (let loop ((iterations (the fixnum 0)) (timings (list)))
     317      (let loop (#;(iterations (the fixnum 0)) (timings (list)))
    310318        (if (< (*realtime-microsecs) threshold)
    311319          (let ((before (*realtime-microsecs)))
     
    313321            (dotimes (_ per-100ms) (thunk))
    314322            (let ((after (*realtime-microsecs)))
    315               (loop (+ iterations per-100ms) (cons (- after before) timings))))
     323              (loop #;(+ iterations per-100ms) (cons (- after before (* per-100ms *iterations-overhead*)) timings))))
    316324          (map (lambda (i) (/ per-100ms (ÎŒs->secs i))) timings) ) ) ) ) )
    317 
    318 ;;
    319 
    320 ;any overhead
    321 (define *iterations-overhead* 0.0)
    322 ;calc any overhead
    323 (define-constant OVERHEAD-ITERATIONS 10000000)
    324 (let ((before (*realtime-microsecs)))
    325   (dotimes (_ OVERHEAD-ITERATIONS) (void))
    326   (set! *iterations-overhead*
    327     (/ (- (*realtime-microsecs) before) OVERHEAD-ITERATIONS)) )
    328325
    329326;@thunk benchmark procedure
Note: See TracChangeset for help on using the changeset viewer.