Skip to content

Commit

Permalink
Don't copy LinuxPerf Stats
Browse files Browse the repository at this point in the history
It's not clear to me how deep the copying should be, but I think this should be fine for now and it matches the semantics of `copy` better.
  • Loading branch information
Zentrik committed Jan 8, 2024
1 parent bbfb733 commit 6503496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function Base.copy(p::Parameters)
p.time_tolerance,
p.memory_tolerance,
p.enable_linux_perf,
copy(p.linux_perf_options),
p.linux_perf_options,
)
end

Expand Down
9 changes: 2 additions & 7 deletions src/trials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Base.copy(t::Trial)
copy(t.gctimes),
t.memory,
t.allocs,
isnothing(t.linux_perf_stats) ? nothing : copy(t.linux_perf_stats),
t.linux_perf_stats,
)
end

Expand Down Expand Up @@ -132,12 +132,7 @@ end

function Base.copy(t::TrialEstimate)
return TrialEstimate(
copy(t.params),
t.time,
t.gctime,
t.memory,
t.allocs,
isnothing(t.linux_perf_stats) ? nothing : copy(t.linux_perf_stats),
copy(t.params), t.time, t.gctime, t.memory, t.allocs, t.linux_perf_stats
)
end

Expand Down

0 comments on commit 6503496

Please sign in to comment.