Skip to content

Commit 55893ef

Browse files
JeffreySarnoffararslan
authored andcommitted
Fix deprecations (#113)
1 parent 0067b5b commit 55893ef

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

benchmark/benchmarks.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
VERSION < v"0.5" && warn("This example uses dot broadcast syntax "*
2-
"and may not work on Julia versions lower"*
3-
" than v0.5!")
41

52
using BenchmarkTools
63

src/groups.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if VERSION < v"0.7.0-DEV.2731"
2323
const empty = similar
2424
end
2525

26-
@compat Base.:(==)(a::BenchmarkGroup, b::BenchmarkGroup) = a.tags == b.tags && a.data == b.data
26+
Base.:(==)(a::BenchmarkGroup, b::BenchmarkGroup) = a.tags == b.tags && a.data == b.data
2727
Base.copy(group::BenchmarkGroup) = BenchmarkGroup(copy(group.tags), copy(group.data))
2828
Base.similar(group::BenchmarkGroup) = BenchmarkGroup(copy(group.tags), empty(group.data))
2929
Base.isempty(group::BenchmarkGroup) = isempty(group.data)
@@ -259,19 +259,19 @@ Base.setindex!(group::BenchmarkGroup, v, k::BenchmarkGroup) = error("A Benchmark
259259

260260
tagrepr(tags) = string("[", join(map(repr, tags), ", "), "]")
261261

262-
Base.showall(io::IO, group::BenchmarkGroup) = @compat show(io, MIME"text/plain"(), group; verbose = true, limit = Inf)
262+
Base.showall(io::IO, group::BenchmarkGroup) = show(io, MIME"text/plain"(), group; verbose = true, limit = Inf)
263263

264264
Base.show(io::IO, group::BenchmarkGroup) = print(io, "$(length(group))-element BenchmarkGroup($(tagrepr(group.tags)))")
265265

266-
@compat function Base.show(io::IO, mime::MIME"text/plain", group::BenchmarkGroup, pad = ""; verbose = false, limit = 10)
266+
function Base.show(io::IO, mime::MIME"text/plain", group::BenchmarkGroup, pad = ""; verbose = false, limit = 10)
267267
println(io, "$(length(group))-element BenchmarkTools.BenchmarkGroup:")
268268
print(io, pad, " tags: ", tagrepr(group.tags))
269269
count = 1
270270
for (k, v) in group
271271
println(io)
272272
print(io, pad, " ", repr(k), " => ")
273273
if verbose && isa(v, BenchmarkGroup)
274-
@compat show(io, mime, v, "\t"*pad; verbose = verbose, limit = limit)
274+
show(io, mime, v, "\t"*pad; verbose = verbose, limit = limit)
275275
else
276276
show(io, v)
277277
end

src/parameters.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Parameters(default::Parameters; seconds = nothing, samples = nothing,
4646
return params::BenchmarkTools.Parameters
4747
end
4848

49-
@compat function Base.:(==)(a::Parameters, b::Parameters)
49+
function Base.:(==)(a::Parameters, b::Parameters)
5050
return a.seconds == b.seconds &&
5151
a.samples == b.samples &&
5252
a.evals == b.evals &&

src/trials.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
Trial(params::Parameters) = Trial(params, Float64[], Float64[], typemax(Int), typemax(Int))
1414

15-
@compat function Base.:(==)(a::Trial, b::Trial)
15+
function Base.:(==)(a::Trial, b::Trial)
1616
return a.params == b.params &&
1717
a.times == b.times &&
1818
a.gctimes == b.gctimes &&
@@ -98,7 +98,7 @@ function TrialEstimate(trial::Trial, t, gct)
9898
return TrialEstimate(params(trial), t, gct, memory(trial), allocs(trial))
9999
end
100100

101-
@compat function Base.:(==)(a::TrialEstimate, b::TrialEstimate)
101+
function Base.:(==)(a::TrialEstimate, b::TrialEstimate)
102102
return a.params == b.params &&
103103
a.time == b.time &&
104104
a.gctime == b.gctime &&
@@ -141,7 +141,7 @@ mutable struct TrialRatio
141141
allocs::Float64
142142
end
143143

144-
@compat function Base.:(==)(a::TrialRatio, b::TrialRatio)
144+
function Base.:(==)(a::TrialRatio, b::TrialRatio)
145145
return a.params == b.params &&
146146
a.time == b.time &&
147147
a.gctime == b.gctime &&
@@ -190,7 +190,7 @@ function TrialJudgement(r::TrialRatio)
190190
return TrialJudgement(r, judge(time(r), ttol), judge(memory(r), mtol))
191191
end
192192

193-
@compat function Base.:(==)(a::TrialJudgement, b::TrialJudgement)
193+
function Base.:(==)(a::TrialJudgement, b::TrialJudgement)
194194
return a.ratio == b.ratio &&
195195
a.time == b.time &&
196196
a.memory == b.memory
@@ -267,7 +267,7 @@ Base.show(io::IO, t::TrialEstimate) = print(io, "TrialEstimate(", prettytime(tim
267267
Base.show(io::IO, t::TrialRatio) = print(io, "TrialRatio(", prettypercent(time(t)), ")")
268268
Base.show(io::IO, t::TrialJudgement) = print(io, "TrialJudgement(", prettydiff(time(ratio(t))), " => ", time(t), ")")
269269

270-
@compat function Base.show(io::IO, ::MIME"text/plain", t::Trial)
270+
function Base.show(io::IO, ::MIME"text/plain", t::Trial)
271271
if length(t) > 0
272272
min = minimum(t)
273273
max = maximum(t)
@@ -300,23 +300,23 @@ Base.show(io::IO, t::TrialJudgement) = print(io, "TrialJudgement(", prettydiff(t
300300
print(io, " evals/sample: ", t.params.evals)
301301
end
302302

303-
@compat function Base.show(io::IO, ::MIME"text/plain", t::TrialEstimate)
303+
function Base.show(io::IO, ::MIME"text/plain", t::TrialEstimate)
304304
println(io, "BenchmarkTools.TrialEstimate: ")
305305
println(io, " time: ", prettytime(time(t)))
306306
println(io, " gctime: ", prettytime(gctime(t)), " (", prettypercent(gctime(t) / time(t)),")")
307307
println(io, " memory: ", prettymemory(memory(t)))
308308
print(io, " allocs: ", allocs(t))
309309
end
310310

311-
@compat function Base.show(io::IO, ::MIME"text/plain", t::TrialRatio)
311+
function Base.show(io::IO, ::MIME"text/plain", t::TrialRatio)
312312
println(io, "BenchmarkTools.TrialRatio: ")
313313
println(io, " time: ", time(t))
314314
println(io, " gctime: ", gctime(t))
315315
println(io, " memory: ", memory(t))
316316
print(io, " allocs: ", allocs(t))
317317
end
318318

319-
@compat function Base.show(io::IO, ::MIME"text/plain", t::TrialJudgement)
319+
function Base.show(io::IO, ::MIME"text/plain", t::TrialJudgement)
320320
println(io, "BenchmarkTools.TrialJudgement: ")
321321
println(io, " time: ", prettydiff(time(ratio(t))), " => ", time(t), " (", prettypercent(params(t).time_tolerance), " tolerance)")
322322
print(io, " memory: ", prettydiff(memory(ratio(t))), " => ", memory(t), " (", prettypercent(params(t).memory_tolerance), " tolerance)")

0 commit comments

Comments
 (0)