-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
62 additions
and
858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module MakieExt | ||
|
||
using Makie | ||
using TypedTables | ||
using PerfChecker | ||
include("plotutils.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
make_colors(l) = Makie.distinguishable_colors(l, [Makie.RGB(1, 1, 1), Makie.RGB(0, 0, 0)], dropseed=true) | ||
|
||
function smart_paths(paths) | ||
splitted_paths = map(splitpath ∘ normpath, paths) | ||
|
||
common = paths |> first |> dirname |> splitpath | ||
for path in splitted_paths | ||
to_pop = length(common) | ||
for name in Iterators.zip(common, path) | ||
name[1] == name[2] || break | ||
to_pop -= 1 | ||
end | ||
foreach(_ -> pop!(common), 1:to_pop) | ||
end | ||
|
||
for path in splitted_paths | ||
foreach(_ -> popfirst!(path), 1:length(common)) | ||
end | ||
|
||
return joinpath(common...), map(joinpath, splitted_paths) | ||
end | ||
|
||
function PerfChecker.table_to_pie(x::Table, ::Val{:alloc}) | ||
data = x.bytes | ||
@info data | ||
paths = smart_paths(x.filenames)[2] .* " " .* string.(x.linenumbers) | ||
percentage = data .* 100 ./ sum(data) | ||
@info percentage | ||
colors = make_colors(length(percentage)) | ||
f, ax, plt = pie(data, | ||
color = colors, | ||
radius = 4, | ||
inner_radius = 2, | ||
strokecolor = :white, | ||
strokewidth = 5, | ||
axis = (autolimitaspect = 1, ), | ||
) | ||
hidedecorations!(ax); | ||
hidespines!(ax) | ||
Legend(f[1,2], [PolyElement(color=c) for c in colors], paths) | ||
f | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de" | ||
CoverageTools = "c36e975a-824b-4404-a568-ef97ca766997" | ||
PatternFolds = "c18a7f1d-76ad-4ce4-950d-5419b888513b" | ||
PerfChecker = "6309bf6b-a531-4b08-891e-8ee981e5c424" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,5 @@ end | |
function perf_table end | ||
|
||
function perf_plot end | ||
|
||
function table_to_pie end |