File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -455,7 +455,8 @@ class BenchmarkDoctor(object):
455
455
[[result .samples .min for result in i_series ]
456
456
for i_series in
457
457
[select (measurements , num_iters = i ) for i in [1 , 2 ]]]]
458
- setup = int (round (2.0 * (ti1 - ti2 ))) if ti2 > 20 else 0
458
+ setup = (int (round (2.0 * (ti1 - ti2 ))) if ti2 > 20 # limit of accuracy
459
+ else 0 )
459
460
ratio = (setup / ti1 ) if ti1 > 0 else 0
460
461
return (setup , ratio )
461
462
Original file line number Diff line number Diff line change @@ -743,17 +743,17 @@ def test_benchmark_has_no_significant_setup_overhead(self):
743
743
doctor .analyze ({'name' : 'Zero' , 'Zero O i1a' : _PTR (min = 0 ),
744
744
'Zero O i2a' : _PTR (min = 0 )})
745
745
doctor .analyze ({
746
- 'name' : 'OOO ' , # Out Of Order
747
- # Impossible to detect overhead -- limits of precision :
746
+ 'name' : 'LOA ' , # Limit of Accuracy
747
+ # Impossible to detect overhead:
748
748
# Even 1μs change in 20μs runtime is 5%.
749
- 'OOO O i1a' : _PTR (min = 21 ),
750
- 'OOO O i2a' : _PTR (min = 20 )})
749
+ 'LOA O i1a' : _PTR (min = 21 ),
750
+ 'LOA O i2a' : _PTR (min = 20 )})
751
751
output = out .getvalue ()
752
752
753
753
self .assertIn ('runtime: ' , output )
754
754
self .assertNotIn ('NoOverhead' , output )
755
755
self .assertNotIn ('ZeroRuntime' , output )
756
- self .assertNotIn ('OOO ' , output )
756
+ self .assertNotIn ('LOA ' , output )
757
757
self .assert_contains (
758
758
["'SO' has setup overhead of 4 μs (5.8%)." ],
759
759
self .logs ['error' ])
You can’t perform that action at this time.
0 commit comments