Skip to content

Commit

Permalink
Changes for Package extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Jan 1, 2024
1 parent ba296ae commit 233816c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
7 changes: 6 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ authors = ["Azzaare <[email protected]>"]
version = "0.2.0"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CoverageTools = "c36e975a-824b-4404-a568-ef97ca766997"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -20,6 +19,12 @@ StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Term = "22787eb5-b846-44ae-b979-8e399b8463ab"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"

[weakdeps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"

[extensions]
PerfCheckerBenchmarkExt = ["BenchmarkTools"]

[compat]
BenchmarkTools = "1"
CSV = "0.10"
Expand Down
8 changes: 8 additions & 0 deletions ext/PerfCheckerBenchmarkExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module PerfCheckerBenchmarkExt

# SECTION - Imports
using BenchmarkTools



end
9 changes: 4 additions & 5 deletions src/PerfChecker.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module PerfChecker

# SECTION - Imports
using BenchmarkTools
using CSV
using DataFrames
using LibGit2
Expand All @@ -13,15 +12,15 @@ using Profile
using Random
using StatsPlots
using Term
import TypedTables: Table
import TypedTables: Table, showtable
import Distributed: remotecall_fetch, addprocs, rmprocs
import CoverageTools: analyze_malloc_files, find_malloc_files, MallocInfo

# SECTION - Exports
export alloc_check
export alloc_plot
export bench_plot
export store_benchmark
# export bench_plot
# export store_benchmark
export @check
export to_table

Expand All @@ -30,7 +29,7 @@ export to_table
include("init.jl")
include("check.jl")
include("alloc.jl")
include("benchmarks.jl")
# include("benchmarks.jl")
include("utils.jl")

end
9 changes: 7 additions & 2 deletions src/alloc.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prep(d::Dict, block::Expr, ::Val{:alloc}) = quote
prep(::Dict, block::Expr, ::Val{:alloc}) = quote
import Pkg
Pkg.instantiate()
import Profile
Expand All @@ -7,7 +7,12 @@ prep(d::Dict, block::Expr, ::Val{:alloc}) = quote
end

function default_options(::Val{:alloc})
return Dict(:threads => 1, :targets => [], :track => "user", :repeat => true)
return Dict(
:threads => 1,
:targets => [],
:track => "user",
:repeat => true,
)
end

function check(d::Dict, block::Expr, ::Val{:alloc})
Expand Down
6 changes: 6 additions & 0 deletions src/check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ macro check(x, d, block1, block2)
$post(di, $x)
end
end

macro check(x, d, block)
quote
@check $x $d nothing $block
end
end

0 comments on commit 233816c

Please sign in to comment.