@@ -8,6 +8,11 @@ mutable struct Trial
8
8
gctimes:: Vector{Float64}
9
9
memory:: Int
10
10
allocs:: Int
11
+ linux_perf_stats:: Union{LinuxPerf.Stats,Nothing}
12
+
13
+ function Trial (params, times, gctimes, memory, allocs, linux_perf_stats= nothing )
14
+ return new (params, times, gctimes, memory, allocs, linux_perf_stats)
15
+ end
11
16
end
12
17
13
18
Trial (params:: Parameters ) = Trial (params, Float64[], Float64[], typemax (Int), typemax (Int))
@@ -21,7 +26,14 @@ function Base.:(==)(a::Trial, b::Trial)
21
26
end
22
27
23
28
function Base. copy (t:: Trial )
24
- return Trial (copy (t. params), copy (t. times), copy (t. gctimes), t. memory, t. allocs)
29
+ return Trial (
30
+ copy (t. params),
31
+ copy (t. times),
32
+ copy (t. gctimes),
33
+ t. memory,
34
+ t. allocs,
35
+ t. linux_perf_stats,
36
+ )
25
37
end
26
38
27
39
function Base. push! (t:: Trial , time, gctime, memory, allocs)
40
52
41
53
Base. length (t:: Trial ) = length (t. times)
42
54
function Base. getindex (t:: Trial , i:: Number )
43
- return push! (Trial (t. params), t. times[i], t. gctimes[i], t. memory, t. allocs)
55
+ return Trial (
56
+ t. params, [t. times[i]], [t. gctimes[i]], t. memory, t. allocs, t. linux_perf_stats
57
+ )
58
+ end
59
+ function Base. getindex (t:: Trial , i)
60
+ return Trial (t. params, t. times[i], t. gctimes[i], t. memory, t. allocs, t. linux_perf_stats)
44
61
end
45
- Base. getindex (t:: Trial , i) = Trial (t. params, t. times[i], t. gctimes[i], t. memory, t. allocs)
46
62
Base. lastindex (t:: Trial ) = length (t)
47
63
48
64
function Base. sort! (t:: Trial )
@@ -98,10 +114,17 @@ mutable struct TrialEstimate
98
114
gctime:: Float64
99
115
memory:: Int
100
116
allocs:: Int
117
+ linux_perf_stats:: Union{LinuxPerf.Stats,Nothing}
118
+
119
+ function TrialEstimate (params, times, gctime, memory, allocs, linux_perf_stats= nothing )
120
+ return new (params, times, gctime, memory, allocs, linux_perf_stats)
121
+ end
101
122
end
102
123
103
124
function TrialEstimate (trial:: Trial , t, gct)
104
- return TrialEstimate (params (trial), t, gct, memory (trial), allocs (trial))
125
+ return TrialEstimate (
126
+ params (trial), t, gct, memory (trial), allocs (trial), trial. linux_perf_stats
127
+ )
105
128
end
106
129
107
130
function Base.:(== )(a:: TrialEstimate , b:: TrialEstimate )
@@ -113,7 +136,9 @@ function Base.:(==)(a::TrialEstimate, b::TrialEstimate)
113
136
end
114
137
115
138
function Base. copy (t:: TrialEstimate )
116
- return TrialEstimate (copy (t. params), t. time, t. gctime, t. memory, t. allocs)
139
+ return TrialEstimate (
140
+ copy (t. params), t. time, t. gctime, t. memory, t. allocs, t. linux_perf_stats
141
+ )
117
142
end
118
143
119
144
function Base. minimum (trial:: Trial )
0 commit comments