Skip to content

Commit b676dd7

Browse files
committed
Revise benchmark results:
- report and restore single time components - replace variance by stdev
1 parent c1e01df commit b676dd7

File tree

12 files changed

+67
-16
lines changed

12 files changed

+67
-16
lines changed

packages/TraceDebuggerBenchmarks.package/Collection.extension/instance/tdbSampleVariance.st

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
tdbSampleVariance
33

44
| avg |
5+
self isEmpty ifTrue: [^ self errorEmptyCollection].
6+
self size = 1 ifTrue: [^ self anyOne].
7+
58
avg := self average.
69
^ (self detectSum: [:ea | (ea - avg) squared]) / (self size - 1)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*TraceDebuggerBenchmarks-math functions
2+
tdbStdev
3+
4+
^ self tdbSampleVariance sqrt

packages/TraceDebuggerBenchmarks.package/Collection.extension/methodProperties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5-
"tdbSampleVariance" : "ct 1/8/2022 17:51" } }
5+
"tdbSampleVariance" : "ct 1/9/2022 01:58",
6+
"tdbStdev" : "ct 1/9/2022 01:45" } }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
privatePostparationTime: aDuration
3+
4+
postparationTime := aDuration
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
privatePreparationTime: aDuration
3+
4+
preparationTime := aDuration
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
privateTotalTime: aDuration
3+
4+
totalTime := aDuration

packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
"preparationTime" : "ct 1/8/2022 19:08",
2323
"prepare:" : "ct 1/8/2022 14:12",
2424
"printOn:" : "ct 1/8/2022 15:44",
25+
"privatePostparationTime:" : "ct 1/9/2022 01:54",
26+
"privatePreparationTime:" : "ct 1/9/2022 01:54",
2527
"privateTimeToRun:" : "ct 1/8/2022 21:30",
28+
"privateTotalTime:" : "ct 1/9/2022 01:55",
2629
"run" : "ct 1/8/2022 14:25",
2730
"runWithoutTimeout" : "ct 1/8/2022 14:26",
2831
"selector" : "ct 1/8/2022 14:09",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
historic data
2+
parseHistoricBench: bench
3+
4+
| meth benchmark |
5+
meth := CompiledCode readFrom:
6+
(bench name copyReplaceAll: '>>' with: ' lookupSelector: ').
7+
benchmark := meth methodClass selector: meth selector.
8+
9+
benchmark privateTimeToRun: bench value milliSeconds.
10+
bench extra ifNotNil: [
11+
| extra |
12+
extra := Json readFrom: bench extra readStream.
13+
benchmark
14+
privateTotalTime: extra totalTime milliSeconds;
15+
privatePreparationTime: extra preparationTime milliSeconds;
16+
privatePostparationTime: extra postparationTime milliSeconds].
17+
18+
^ benchmark

packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/parseHistoricRawData..st

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ parseHistoricRawData: rawData
1818
entry index: index]].
1919
rawData entries do: [:entries |
2020
entries do: [:entry |
21-
entry benches do: [:bench |
22-
bench benchmark: (benchmarks at: bench name put: [ | meth |
23-
meth := CompiledCode readFrom: (bench name copyReplaceAll: '>>' with: ' lookupSelector: ').
24-
(meth methodClass selector: meth selector)
25-
privateTimeToRun: bench value milliSeconds;
26-
yourself] value)]]].
21+
entry benches do: [:bench | | benchmark |
22+
benchmark := self parseHistoricBench: bench.
23+
benchmarks at: bench name put: benchmark.
24+
bench benchmark: benchmark]]].
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
exporting
2+
resultAsJson: benches
3+
4+
| timesToRun |
5+
timesToRun := benches collect: [:ea | ea timeToRun asMilliSeconds].
6+
^ JsonObject new
7+
name: benches anyOne shortPrintString;
8+
unit: 'Milliseconds';
9+
value: timesToRun average asFloat;
10+
range: ('stdev: {1}' format: {timesToRun tdbSampleVariance asFloat});
11+
extra: (JsonObject new
12+
totalTime: (benches collect: [:ea | ea totalTime asMilliSeconds]) average;
13+
preparationTime: (benches collect: [:ea | ea preparationTime asMilliSeconds]) average;
14+
postparationTime: (benches collect: [:ea | ea postparationTime asMilliSeconds]) average;
15+
asJsonString);
16+
yourself

0 commit comments

Comments
 (0)