Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version #52

Merged
merged 15 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "PerfChecker"
uuid = "6309bf6b-a531-4b08-891e-8ee981e5c424"
authors = ["Azzaare <[email protected]>"]
version = "0.2.0"
version = "0.2.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CoverageTools = "c36e975a-824b-4404-a568-ef97ca766997"
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Malt = "36869731-bdee-424d-aa32-cab38c994e3b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down Expand Up @@ -34,6 +34,7 @@ CpuId = "0.3"
JSON = "0.21"
Makie = "0.21"
Malt = "1"
TOML = "1"
TypedTables = "1"
julia = "1.9"

Expand Down
75 changes: 46 additions & 29 deletions ext/MakieExt/allocs.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
function PerfChecker.table_to_pie(x::Table, ::Val{:alloc}; pkg_name = "")
data = x.bytes
paths = smart_paths(x.filenames)[2] .* " — line " .* string.(x.linenumbers)
percentage = data .* 100 ./ sum(data)
colors = make_colors(length(percentage))
str = isempty(pkg_name) ? "" : " for $pkg_name"
f, ax, _ = pie(
data;
axis = (autolimitaspect = 1,),
color = colors,
inner_radius = 2,
radius = 4,
strokecolor = :white,
strokewidth = 5
)
ax.title = "Mallocs$str"
hidedecorations!(ax)
hidespines!(ax)
Legend(f[1, 2], [PolyElement(color = c) for c in colors], paths)
return f
if !isempty(x.filenames)
data = x.bytes
paths = smart_paths(x.filenames)[2] .* " — line " .* string.(x.linenumbers)
percentage = data .* 100 ./ sum(data)
colors = make_colors(length(percentage))
str = isempty(pkg_name) ? "" : " for $pkg_name"
f, ax, _ = pie(
data;
axis = (autolimitaspect = 1,),
color = colors,
inner_radius = 2,
radius = 4,
strokecolor = :white,
strokewidth = 5
)
ax.title = "Mallocs$str"
hidedecorations!(ax)
hidespines!(ax)
Legend(f[1, 2], [PolyElement(color = c) for c in colors], paths)
return f
else
@error "No allocations so can't plot!"
return nothing
end
end

function PerfChecker.checkres_to_pie(x::PerfChecker.CheckerResult, ::Val{:alloc})
Expand All @@ -34,16 +39,20 @@ function PerfChecker.checkres_to_scatterlines(
j = x.tables[i]
p = x.pkgs[i]
u = unique(j.filenames)
paths = smart_paths(u)[2]
for k in eachindex(u)
if haskey(di, paths[k])
push!(di[paths[k]], (sum(j.bytes[j.filenames .== u[k]]), p.version))
else
di[paths[k]] = [(sum(j.bytes[j.filenames .== u[k]]), p.version)]
if !isempty(u)
paths = smart_paths(u)[2]
for k in eachindex(u)
if haskey(di, paths[k])
push!(di[paths[k]], (sum(j.bytes[j.filenames .== u[k]]), p.version))
else
di[paths[k]] = [(sum(j.bytes[j.filenames .== u[k]]), p.version)]
end
end
else
@error "No allocations so can't plot!"
return nothing
end
end

versions = Dict()
for i in eachindex(x.pkgs)
versions[x.pkgs[i].version] = i
Expand All @@ -52,16 +61,24 @@ function PerfChecker.checkres_to_scatterlines(
versionnums = [x.pkgs[i].version for i in eachindex(x.pkgs)]
f = Figure()
ax = Axis(f[1, 1])
ax.yscale = Makie.pseudolog10
ax.xticks = (eachindex(versionnums), string.(versionnums))
ax.xlabel = "versions"
ax.ylabel = "bytes"
colors = make_colors(length(keys(di)))
i = 1

lx = length(versionnums)
ly = length(keys(di))
step = 0.02 * (lx - 1)
diff = (1 - ly) * step / 2.0

for (keys, values) in di
xs = [values[i][1] for i in eachindex(values)]
ys = [versions[values[i][2]] for i in eachindex(values)]
scatterlines!(f[1, 1], ys, xs, label = keys, color = (colors[i], 0.6))
ys = [values[i][1] for i in eachindex(values)]
xs = [versions[values[i][2]] for i in eachindex(values)] .+ diff
scatterlines!(f[1, 1], xs, ys, label = keys, color = (colors[i], 1.0))
i += 1
diff += step
end
ax.title = x.pkgs[1].name
Legend(f[1, 2], ax)
Expand Down
28 changes: 20 additions & 8 deletions ext/MakieExt/bench.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function PerfChecker.checkres_to_scatterlines(
end

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

v = map(y -> filter(x -> x > 0, y), d)

r = minimum.(d)

versionnums = [x.pkgs[i].version for i in eachindex(x.pkgs)]
Expand All @@ -18,20 +21,29 @@ function PerfChecker.checkres_to_scatterlines(
ax = f[1, 1] = Axis(f)
colors = make_colors(length(props))
max = 2

lx = length(versionnums)
ly = length(data[1])
step = 0.02 * (lx - 1)
diff = (1 - ly) * step / 2.0

for i in eachindex(data[1])
xs = collect(eachindex(versionnums))
ys = d[i] ./ r[i]
if max < maximum(ys)
max = maximum(ys)
xs = collect(eachindex(versionnums)) .+ diff
ys = [isempty(v[i]) ? 0 : d[i][j] / r[i] for j in eachindex(d[i])]
t = maximum(ys)
if max < ϵ(t)
max = ϵ(t)
end
scatterlines!(xs, ys, label = string(props[i]), color = (colors[i], 0.4))
scatterlines!(
xs, ys; label = string(props[i]), color = (colors[i], 1.0), linewidth = 0.5)
diff += step
end
ax.yscale = Makie.pseudolog10
ax.xticks = (eachindex(versionnums), string.(versionnums))
ax.xlabel = "versions"
ax.ylabel = "ratio"
ax.title = "Evolution for $(x.pkgs[1].name) (via BenchmarkTools.jl)"
ylims!(; low = 0, high = max)
axislegend()
f[1, 2] = Legend(f, ax)
return f
end

Expand All @@ -55,6 +67,6 @@ function PerfChecker.checkres_to_boxplots(
ax.ylabel = string(kwarg)
boxplot!(datax, datay, label = string(kwarg))
ax.title = x.pkgs[1].name
axislegend()
f[1, 2] = Legend(f, ax)
return f
end
28 changes: 20 additions & 8 deletions ext/MakieExt/chair.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function PerfChecker.checkres_to_scatterlines(
end

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

v = map(y -> filter(x -> x > 0, y), d)

r = minimum.(d)

versionnums = [x.pkgs[i].version for i in eachindex(x.pkgs)]
Expand All @@ -18,20 +21,29 @@ function PerfChecker.checkres_to_scatterlines(
ax = f[1, 1] = Axis(f)
colors = make_colors(length(props))
max = 2

lx = length(versionnums)
ly = length(data[1])
step = 0.02 * (lx - 1)
diff = (1 - ly) * step / 2.0

for i in eachindex(data[1])
xs = collect(eachindex(versionnums))
ys = d[i] ./ r[i]
if max < maximum(ys)
max = maximum(ys)
xs = collect(eachindex(versionnums)) .+ diff
ys = [isempty(v[i]) ? 0 : d[i][j] / r[i] for j in eachindex(d[i])]
t = maximum(ys)
if max < ϵ(t)
max = ϵ(t)
end
scatterlines!(xs, ys, label = string(props[i]), color = (colors[i], 0.4))
scatterlines!(
xs, ys; label = string(props[i]), color = (colors[i], 1.0), linewidth = 0.5)
diff += step
end
ax.yscale = Makie.pseudolog10
ax.xticks = (eachindex(versionnums), string.(versionnums))
ax.xlabel = "versions"
ax.ylabel = "ratio"
ax.title = "Evolution for $(x.pkgs[1].name) (via Chairmarks.jl)"
ylims!(; low = 0, high = max)
axislegend()
f[1, 2] = Legend(f, ax)
return f
end

Expand All @@ -56,6 +68,6 @@ function PerfChecker.checkres_to_boxplots(
ax.ylabel = string(kwarg)
boxplot!(datax, datay, label = string(kwarg))
ax.title = x.pkgs[1].name
axislegend()
f[1, 2] = Legend(f, ax)
return f
end
3 changes: 3 additions & 0 deletions ext/MakieExt/plotutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ function smart_paths(paths)

return joinpath(common...), map(joinpath, split_paths)
end

# Fix the maximum limit in plot by some epsilon for log scale plots
ϵ(x; adjust = 0.1 * log(10)) = x * exp(adjust)
Binary file modified perf/GLM/visuals/bench_boxplots_allocs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/bench_boxplots_gctimes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/bench_boxplots_memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/bench_boxplots_times.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/bench_evolution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/chair_boxplots_allocs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/chair_boxplots_bytes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/chair_boxplots_gctimes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/chair_boxplots_times.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified perf/GLM/visuals/chair_evolution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 17 additions & 7 deletions perf/PatternFolds/metadata/metadata.csv
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
chairmark_PatternFolds_v0.2.0_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
chairmark_PatternFolds_v0.2.1_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
chairmark_PatternFolds_v0.2.2_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
chairmark_PatternFolds_v0.2.3_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
chairmark_PatternFolds_v0.2.4_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
benchmark_PatternFolds_v0.2.0_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
benchmark_PatternFolds_v0.2.1_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
benchmark_PatternFolds_v0.2.2_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
benchmark_PatternFolds_v0.2.3_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
benchmark_PatternFolds_v0.2.4_patterns_intervals,e0de2879-5d35-4872-bb8d-5e092227a858
alloc_PatternFolds_v0.2.0_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.1_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.2_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.3_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.4_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.0_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
alloc_PatternFolds_v0.2.1_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.0_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.1_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.2_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.3_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.4_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
benchmark_PatternFolds_v0.2.0_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
benchmark_PatternFolds_v0.2.1_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
benchmark_PatternFolds_v0.2.2_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
benchmark_PatternFolds_v0.2.3_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
benchmark_PatternFolds_v0.2.4_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.0_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.1_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.2_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.3_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
chairmark_PatternFolds_v0.2.4_patterns_intervals,36c9068f-2e67-410b-b8bb-d57c1b476f62
Loading
Loading