Skip to content

Update benchmarks #231

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

Merged
merged 1 commit into from
May 25, 2023
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
7 changes: 3 additions & 4 deletions benchmark/generate_report.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#
# Copyright (c) 2015: Jarrett Revels.

using Printf

const REGRESS_MARK = ":x:"
const IMPROVE_MARK = ":white_check_mark:"

Expand All @@ -27,10 +29,7 @@ function printreport(io::IO, results; iscomparisonjob::Bool = false)

entries = BenchmarkTools.leaves(results)

try
entries = entries[sortperm(map(x -> string(first(x)), entries))]
end

entries = entries[sortperm(map(x -> string(first(x)), entries))]

for (ids, t) in entries
if !(iscomparisonjob) || BenchmarkTools.isregression(t) || BenchmarkTools.isimprovement(t)
Expand Down
21 changes: 11 additions & 10 deletions benchmark/runbenchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BlockArrays
using BenchmarkTools
using FileIO
using JLD

include("generate_report.jl")

Expand All @@ -15,23 +16,23 @@ for n = (5,)
block_vec = BT(rand(n), [1,3,1])
block_mat = BT(rand(n,n), [1,3,1], [4,1])
block_arr = BT(rand(n,n,n), [1,3,1], [4,1], [3, 2])
g["getindex", BT.name.name, "vector", n] = @benchmarkable getindex($block_vec, 3)
g["getindex", BT.name.name, "matrix", n] = @benchmarkable getindex($block_mat, 3, 2)
g["getindex", BT.name.name, "rank3", n] = @benchmarkable getindex($block_arr, 3, 2 ,3)
g["getindex", nameof(BT), "vector", n] = @benchmarkable getindex($block_vec, 3)
g["getindex", nameof(BT), "matrix", n] = @benchmarkable getindex($block_mat, 3, 2)
g["getindex", nameof(BT), "rank3", n] = @benchmarkable getindex($block_arr, 3, 2 ,3)

g["setindex!", BT.name.name, "vector", n] = @benchmarkable setindex!($block_vec, 3)
g["setindex!", BT.name.name, "matrix", n] = @benchmarkable setindex!($block_mat, 3, 2)
g["setindex!", BT.name.name, "rank3", n] = @benchmarkable setindex!($block_arr, 3, 2 ,3)
g["setindex!", nameof(BT), "vector", n] = @benchmarkable setindex!($block_vec, 1, 3)
g["setindex!", nameof(BT), "matrix", n] = @benchmarkable setindex!($block_mat, 1, 3, 2)
g["setindex!", nameof(BT), "rank3", n] = @benchmarkable setindex!($block_arr, 1, 3, 2 ,3)

g_size[BT.name.name, "vector", n] = @benchmarkable size($block_vec)
g_size[BT.name.name, "matrix", n] = @benchmarkable size($block_mat)
g_size[BT.name.name, "rank3", n] = @benchmarkable size($block_arr)
g_size[nameof(BT), "vector", n] = @benchmarkable size($block_vec)
g_size[nameof(BT), "matrix", n] = @benchmarkable size($block_mat)
g_size[nameof(BT), "rank3", n] = @benchmarkable size($block_arr)
end
end


function run_benchmarks(name, tagfilter = @tagged ALL)
const paramspath = joinpath(dirname(@__FILE__), "params.jld")
paramspath = joinpath(dirname(@__FILE__), "params.jld")
if !isfile(paramspath)
println("Tuning benchmarks...")
tune!(SUITE, verbose=true)
Expand Down