Skip to content

Commit

Permalink
Add scatterlines
Browse files Browse the repository at this point in the history
  • Loading branch information
VarLad committed May 21, 2024
1 parent b53538e commit f9928f0
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 5 deletions.
32 changes: 29 additions & 3 deletions ext/MakieExt/bench.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
function PerfChecker.checkres_to_scatterlines(
x::PerfChecker.CheckerResult, ::Val{:benchmark})
println("Hello!")
@warn "Here!"
data = []
props = TypedTables.columnnames(x.tables[1])
for i in eachindex(x.tables)
t = x.tables[i]
m = [map(TypedTables.GetProperty{i}(), t) for i in props]
g = minimum.(m)
push!(data, g)
end

d = [[data[i][j] for i in eachindex(data)] for j in eachindex(data[1])]
r = minimum.(d)

versionnums = [x.pkgs[i].version for i in eachindex(x.pkgs)]

f = Figure()
ax = f[1,1] = Axis(f)
colors = make_colors(length(props))
for i in eachindex(data[1])
xs = collect(eachindex(versionnums))
ys = d[i] ./ r[i]
scatterlines!(xs, ys, label=string(props[i]), color = (colors[i], 0.4))
end
ax.xticks = (eachindex(versionnums), string.(versionnums))
ax.xlabel = "versions"
ax.ylabel = "ratio"
ax.title = "Evolution for $(x.pkgs[1].name) (via BenchmarkTools.jl)"
axislegend()
return f
end

function PerfChecker.checkres_to_boxplots(
x::PerfChecker.CheckerResult, ::Val{:benchmark}; kwarg::Symbol = :times)
di = Dict()
datax, datay = [], []

for i in eachindex(x.tables)
Expand All @@ -24,6 +49,7 @@ function PerfChecker.checkres_to_boxplots(
ax.xlabel = "versions"
ax.ylabel = string(kwarg)
boxplot!(datax, datay, label=string(kwarg))
ax.title = x.pkgs[1].name
axislegend()
return f
end
32 changes: 30 additions & 2 deletions ext/MakieExt/chair.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
function PerfChecker.checkres_to_scatterlines(
x::PerfChecker.CheckerResult, ::Val{:chairmark})
println("Hello!")
@warn "Here!"
data = []
props = TypedTables.columnnames(x.tables[1])
for i in eachindex(x.tables)
t = x.tables[i]
m = [map(TypedTables.GetProperty{i}(), t) for i in props]
g = minimum.(m)
push!(data, g)
end

d = [[data[i][j] for i in eachindex(data)] for j in eachindex(data[1])]
r = minimum.(d)

versionnums = [x.pkgs[i].version for i in eachindex(x.pkgs)]

f = Figure()
ax = f[1,1] = Axis(f)
colors = make_colors(length(props))
for i in eachindex(data[1])
xs = collect(eachindex(versionnums))
ys = d[i] ./ r[i]
scatterlines!(xs, ys, label=string(props[i]), color = (colors[i], 0.4))
end
ax.xticks = (eachindex(versionnums), string.(versionnums))
ax.xlabel = "versions"
ax.ylabel = "ratio"
ax.title = "Evolution for $(x.pkgs[1].name) (via Chairmarks.jl)"
axislegend()
return f
end


function PerfChecker.checkres_to_boxplots(
x::PerfChecker.CheckerResult, ::Val{:chairmark}; kwarg::Symbol = :times)
di = Dict()
Expand All @@ -24,6 +51,7 @@ function PerfChecker.checkres_to_boxplots(
ax.xlabel = "versions"
ax.ylabel = string(kwarg)
boxplot!(datax, datay, label=string(kwarg))
ax.title = x.pkgs[1].name
axislegend()
return f
end
2 changes: 2 additions & 0 deletions perf/PatternFolds/bench.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ end
@info t

checkres_to_boxplots(t, Val(:benchmark))
c = checkres_to_scatterlines(t, Val(:benchmark))
save(joinpath(homedir(), "ubab.png"), c)
2 changes: 2 additions & 0 deletions perf/PatternFolds/chair.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ end

@info t
checkres_to_boxplots(t, Val(:chairmark))
c = checkres_to_scatterlines(t, Val(:chairmark))
save(joinpath(homedir(), "ubac.png"), c)

0 comments on commit f9928f0

Please sign in to comment.