Changeset 39393 in project


Ignore:
Timestamp:
11/27/20 14:44:38 (8 weeks ago)
Author:
Kon Lovett
Message:

be explicit - test expr & test result, add "raw" test to bigO measure

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

Legend:

Unmodified
Added
Removed
  • release/5/micro-benchmark/trunk/tests/micro-benchmark-test-utils.scm

    r39386 r39393  
    11;;;;
     2
     3;NOTE (sleep i) seems to actually sleep i-1 seconds on windows
    24
    35;;
     
    911    ((_ ?msg ?O ?expr)
    1012     (test-assert ?msg (bigO= ?O ?expr)) ) ) )
    11 
    12 ;;
    13 
    14 ;NOTE (sleep i) seems to actually sleep i-1 seconds on windows
    15 (define-constant SLEEP-TIME 2)
    16 
    17 (define (busy-work)
    18   (import (chicken time posix))
    19   (sleep SLEEP-TIME) )
    2013
    2114;;
  • release/5/micro-benchmark/trunk/tests/micro-benchmark-test.scm

    r39386 r39393  
    3333)
    3434
     35(test-group "benchmark-measure"
     36  (wait-message)
     37  (test-bigO "benchmark-measure returns runtime" 1000000.0 (benchmark-measure (sleep 2)))
     38  (wait-message)
     39  (parameterize ((current-test-epsilon 0.009))
     40    (test 1.00 (ÎŒs->secs (benchmark-measure (sleep 1))))
     41  )
     42)
     43
    3544(parameterize ((current-test-epsilon 0.001)
    3645               (current-benchmark-statistics-set #t)
    3746               (current-benchmark-iterations 3) )
    38 
    39   (test-group "benchmark-measure"
    40     (wait-message)
    41     (test-bigO "benchmark-measure returns runtime"
    42       1000000.0 (benchmark-measure (busy-work) 'test))
    43   )
    44 
    4547  (test-group "benchmark-run"
    4648    (let (
     
    5052            (begin
    5153              (wait-message)
    52               (benchmark-measure-run (begin (busy-work) 'test)))) )
     54              (benchmark-measure-run (begin (sleep 2))))) )
    5355          (generate-statistics runs (current-benchmark-statistics-set)))) )
    5456      #;(gloss stats)
     
    5961
    6062    (let ((stats (benchmark-run (1) #t)))
    61       (test "deviation for a single result" 0.0 (stats-item sd stats))
    62       #;(gloss stats) )
     63      #;(gloss stats)
     64      (test "deviation for a single result" 0.0 (stats-item sd stats)) )
    6365  )
    6466)
Note: See TracChangeset for help on using the changeset viewer.