Skip to content

Commit e5058d9

Browse files
committed
benchmarks: Split out suites
Split suites out into individual files Provide usage info when run without BENCHMARK env var Add option to save logs to output file Add DTable CSV/Arrow reading suite
1 parent dbc4b50 commit e5058d9

File tree

5 files changed

+490
-241
lines changed

5 files changed

+490
-241
lines changed

Diff for: benchmarks/analysis.jl

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
path = ARGS[1]
2+
start, finish = parse.(UInt64, ARGS[2:3])
3+
4+
using DataFrames, BenchmarkTools, Dagger, Serialization
5+
6+
logs = deserialize(path)["logs"]
7+
8+
"""
9+
spans(logs::DataFrame) -> DataFrame
10+
11+
Combines start and finish event pairs, and computes their timespan.
12+
"""
13+
function spans(logs)
14+
df = Any[]
15+
evs = Dict{Symbol,Dict{Any,Any}}()
16+
for log in eachrow(logs)
17+
_evs = get!(evs, log.core.category) do
18+
Dict{Any,Any}()
19+
end
20+
if log.core.kind == :finish
21+
if haskey(_evs, log.id)
22+
start = pop!(_evs, log.id)
23+
ev = merge(log, (;span=(start.core.timestamp, log.core.timestamp)))
24+
push!(df, ev)
25+
else
26+
@warn "Dropped :finish for $(log.core.category)"
27+
end
28+
elseif log.core.kind == :start
29+
_evs[log.id] = log
30+
end
31+
end
32+
DataFrame(df)
33+
end
34+
35+
# Combine, select target range, and filter out `take`
36+
tgt = subset(spans(logs), :core=>ByRow(x->start <= x.timestamp <= finish),
37+
:core=>ByRow(x->x.category != :take))
38+
39+
# Sort by largest time contribution
40+
tgt_sort = DataFrame(sort(eachrow(tgt), by=r->r.span[2] - r.span[1], rev=true))
41+
transform!(tgt_sort, :span=>ByRow(s->(s[2]-s[1]) / (1000^3))=>:span_s)
42+
println("Total: $((finish-start) / (1000^3))")
43+
foreach(println, zip(map(c->c.category, tgt_sort.core), tgt_sort.span_s))

0 commit comments

Comments
 (0)