From be974c635b965e800b88e127d747227dddb671e4 Mon Sep 17 00:00:00 2001 From: aminya Date: Sun, 5 Jan 2020 17:47:05 +0330 Subject: [PATCH] rename snoopiBenchBot ro snoopiBench https://github.com/timholy/SnoopCompile.jl/pull/49#discussion_r362527787 --- docs/src/bot.md | 6 ++--- src/bot.jl | 4 ++-- src/bot/{snoopiBenchBot.jl => snoopiBench.jl} | 24 +++++++++---------- test/bot/bot.jl | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) rename src/bot/{snoopiBenchBot.jl => snoopiBench.jl} (84%) diff --git a/docs/src/bot.md b/docs/src/bot.md index b1f49d412..253d1bed3 100644 --- a/docs/src/bot.md +++ b/docs/src/bot.md @@ -127,14 +127,14 @@ Benchmarking the load infer time ```julia println("loading infer benchmark") -@snoopiBenchBot "MatLang" using MatLang +@snoopiBench "MatLang" using MatLang ``` Benchmarking the example infer time ```julia println("examples infer benchmark") -@snoopiBenchBot "MatLang" begin +@snoopiBench "MatLang" begin using MatLang examplePath = joinpath(dirname(dirname(pathof(MatLang))), "examples") # include(joinpath(examplePath,"Language_Fundamentals", "usage_Entering_Commands.jl")) @@ -145,7 +145,7 @@ end Benchmarking the tests: ```julia -@snoopiBenchBot "MatLang" +@snoopiBench "MatLang" ``` [Ref](https://github.com/juliamatlab/MatLang/blob/master/deps/SnoopCompile/snoopBenchmark.jl) diff --git a/src/bot.jl b/src/bot.jl index 5745e87ab..61e16e497 100644 --- a/src/bot.jl +++ b/src/bot.jl @@ -1,4 +1,4 @@ -export precompile_activator, precompile_deactivator, precompile_pather, @snoopiBot, @snoopiBenchBot, BotConfig +export precompile_activator, precompile_deactivator, precompile_pather, @snoopiBot, @snoopiBench, BotConfig const UStrings = Union{AbstractString,Regex,AbstractChar} ################################################################ @@ -27,4 +27,4 @@ end include("bot/botutils.jl") include("bot/precompileInclude.jl") include("bot/snoopiBot.jl") -include("bot/snoopiBenchBot.jl") +include("bot/snoopiBench.jl") diff --git a/src/bot/snoopiBenchBot.jl b/src/bot/snoopiBench.jl similarity index 84% rename from src/bot/snoopiBenchBot.jl rename to src/bot/snoopiBench.jl index 6245d2184..08ff13e9c 100644 --- a/src/bot/snoopiBenchBot.jl +++ b/src/bot/snoopiBench.jl @@ -2,12 +2,12 @@ """ timesum(snoop) -Calculates and prints the total time measured by a snoop macro. It is used inside @snoopiBenchBot. +Calculates and prints the total time measured by a snoop macro. It is used inside @snoopiBench. -Julia can cache inference results so to measure the effect of adding _precompile_() sentences generated by snoopi to your package, use the [`@snoopiBenchBot`](@ref). This benchmark measures inference time taken during loading and running of a package. +Julia can cache inference results so to measure the effect of adding _precompile_() sentences generated by snoopi to your package, use the [`@snoopiBench`](@ref). This benchmark measures inference time taken during loading and running of a package. -## Manually benchmarking withtout using [`@snoopiBenchBot`](@ref) +## Manually benchmarking withtout using [`@snoopiBench`](@ref) - dev your package - comment the precompile part of your package (`include()` and `_precompile_()`) @@ -46,8 +46,8 @@ end ################################################################ """ - @snoopiBenchBot(packageName::String, snoopScript::Expr) - @snoopiBenchBot(packageName::String) + @snoopiBench(packageName::String, snoopScript::Expr) + @snoopiBench(packageName::String) Performs an infertime benchmark by activating and deactivating the _precompile_() # Examples @@ -55,14 +55,14 @@ Benchmarking the load infer time ```julia println("loading infer benchmark") -@snoopiBenchBot "MatLang" using MatLang +@snoopiBench "MatLang" using MatLang ``` Benchmarking the example infer time ```julia println("examples infer benchmark") -@snoopiBenchBot "MatLang" begin +@snoopiBench "MatLang" begin using MatLang examplePath = joinpath(dirname(dirname(pathof(MatLang))), "examples") # include(joinpath(examplePath,"Language_Fundamentals", "usage_Entering_Commands.jl")) @@ -71,7 +71,7 @@ println("examples infer benchmark") end ``` """ -macro snoopiBenchBot(packageName::String, snoopScript::Expr) +macro snoopiBench(packageName::String, snoopScript::Expr) ################################################################ packagePath = joinpath(pwd(),"src","$packageName.jl") @@ -115,14 +115,14 @@ macro snoopiBenchBot(packageName::String, snoopScript::Expr) end """ - @snoopiBenchBot packageName::String + @snoopiBench packageName::String Benchmarking the infer time of the tests: ```julia -@snoopiBenchBot "MatLang" +@snoopiBench "MatLang" ``` """ -macro snoopiBenchBot(packageName::String) +macro snoopiBench(packageName::String) package = Symbol(packageName) snoopScript = :( using $(package); @@ -130,6 +130,6 @@ macro snoopiBenchBot(packageName::String) include(runtestpath); ) return quote - @snoopiBenchBot $packageName $(snoopScript) + @snoopiBench $packageName $(snoopScript) end end diff --git a/test/bot/bot.jl b/test/bot/bot.jl index 9440be810..267d04bc5 100644 --- a/test/bot/bot.jl +++ b/test/bot/bot.jl @@ -40,13 +40,13 @@ cd(@__DIR__) end end - @testset "snoopiBenchBot" begin + @testset "snoopiBench" begin using Pkg; Pkg.develop("MatLang") examplePath = Base.read(`cmd /c julia -e 'import MatLang; print(pathof(MatLang))'`, String) cd(dirname(dirname(examplePath))) - @snoopiBenchBot "MatLang" begin + @snoopiBench "MatLang" begin using MatLang examplePath = joinpath(dirname(dirname(pathof(MatLang))), "examples") # include(joinpath(examplePath,"Language_Fundamentals", "usage_Entering_Commands.jl"))