-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize load time and TTFX for non-comparison cases. (#137)
- Separate _benchmark_1 from benchmark and eliminate keyword arguments - Move bench out of _benchmark_1 into its own toplevel function _benchmark_2 - Inline a constant - Update precompile directives Comparison of PR to 1.2.2 ```julia-repl julia> f(expr; old=false, show=false) = eval(Meta.parse(read(`julia $(old ? () : "--project") $(show ? "--trace-compile=stderr" : ()) -E $("a = @Elapsed using Chairmarks; a,@Elapsed @eval $expr")`, String))) f (generic function with 3 methods) julia> comp(x) = f(x, old=true) => f(x) comp (generic function with 1 method) julia> comp("@b rand evals=1 samples=1") (0.008544065, 0.038519668) => (0.008942193, 0.033227878) julia> comp("@b rand hash seconds=.001") (0.00854119, 0.046308936) => (0.009106361, 0.038525668) julia> comp("@b rand hash(_) seconds=.001") (0.008300188, 0.051189014) => (0.008772066, 0.038625961) julia> comp("@b rand hash evals=1 samples=1") (0.008669608, 0.041850652) => (0.008984026, 0.037786705) julia> comp("@b rand hash(_),hash evals=1 samples=1") # This has a major behavior change (0.008611357, 0.048080741) => (0.008755858, 0.336857771) ```
- Loading branch information
1 parent
dfb6b6b
commit ea0fe66
Showing
2 changed files
with
42 additions
and
30 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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
precompile(minimum, (Benchmark,)) | ||
precompile(summarize, (Benchmark,)) | ||
precompile(process_args, (Any,)) | ||
precompile(create_function, (Symbol,)) | ||
precompile(benchmark, (Any,Any,Tuple{Any},Any)) | ||
precompile(create_first_function, (Symbol,)) | ||
precompile(create_function, (Expr,)) | ||
precompile(create_first_function, (Expr,)) | ||
precompile(_benchmark_1, (Any,Any,Any,Int,Int,Float64,Bool,Any)) | ||
precompile(Base.show, (IO, MIME"text/plain", Sample)) |