Skip to content

Commit

Permalink
separate sysimage output from precompilation report
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed May 13, 2022
1 parent b1502f6 commit 8d02bca
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions contrib/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,15 @@ function generate_precompile_statements()
n_succeeded > 1200 || @warn "Only $n_succeeded precompile statements"
end

println("Outputting sysimage file...")

include_time *= 1e9
gen_time = (time_ns() - start_time) - include_time
tot_time = time_ns() - start_time

println("Precompilation complete. Summary:")
print("Generation ── "); Base.time_print(gen_time); print(" "); show(IOContext(stdout, :compact=>true), gen_time / tot_time * 100); println("%")
print("Execution ─── "); Base.time_print(include_time); print(" "); show(IOContext(stdout, :compact=>true), include_time / tot_time * 100); println("%")
print("Total ─────── "); Base.time_print(tot_time); println()

# Print report after sysimage has been saved so all time spent can be captured
Base.postoutput() do
tot_time = time_ns() - start_time
output_time = tot_time - gen_time - include_time
println("Precompilation complete. Summary:")
print("Generation ── "); Base.time_print(gen_time); print(" "); show(IOContext(stdout, :compact=>true), gen_time / tot_time * 100); println("%")
print("Execution ─── "); Base.time_print(include_time); print(" "); show(IOContext(stdout, :compact=>true), include_time / tot_time * 100); println("%")
print("Output ────── "); Base.time_print(output_time); print(" "); show(IOContext(stdout, :compact=>true), output_time / tot_time * 100); println("%")
print("Total ─────── "); Base.time_print(tot_time); println()
end
return
end

Expand All @@ -453,4 +447,13 @@ empty!(Base.ARGS)
empty!(Core.ARGS)

end # @eval
end # if

println("Outputting sysimage file...")
let pre_output_time = time_ns()
# Print report after sysimage has been saved so all time spent can be captured
Base.postoutput() do
output_time = time_ns() - pre_output_time
print("Output ────── "); Base.time_print(output_time); println()
end
end

0 comments on commit 8d02bca

Please sign in to comment.