@@ -8,6 +8,11 @@ mutable struct Trial
88 gctimes:: Vector{Float64}
99 memory:: Int
1010 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
1116end
1217
1318Trial (params:: Parameters ) = Trial (params, Float64[], Float64[], typemax (Int), typemax (Int))
@@ -21,7 +26,14 @@ function Base.:(==)(a::Trial, b::Trial)
2126end
2227
2328function 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+ )
2537end
2638
2739function Base. push! (t:: Trial , time, gctime, memory, allocs)
4052
4153Base. length (t:: Trial ) = length (t. times)
4254function 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)
4461end
45- Base. getindex (t:: Trial , i) = Trial (t. params, t. times[i], t. gctimes[i], t. memory, t. allocs)
4662Base. lastindex (t:: Trial ) = length (t)
4763
4864function Base. sort! (t:: Trial )
@@ -98,10 +114,17 @@ mutable struct TrialEstimate
98114 gctime:: Float64
99115 memory:: Int
100116 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
101122end
102123
103124function 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+ )
105128end
106129
107130function Base.:(== )(a:: TrialEstimate , b:: TrialEstimate )
@@ -113,7 +136,9 @@ function Base.:(==)(a::TrialEstimate, b::TrialEstimate)
113136end
114137
115138function 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+ )
117142end
118143
119144function Base. minimum (trial:: Trial )
0 commit comments