Skip to content

Adding more wholistic precompilation workload #196

@Moelf

Description

@Moelf

following development of JuliaLang/julia#47184, it seems that this package would benefit from including realistic composite workload.

For example, consider this slow TTFP:

julia> using PrettyTables

julia> @time @eval pretty_table(devnull, Dict(:a=>rand(10), :b=>rand(Float32, 10)))
  0.778972 seconds (1.74 M allocations: 114.494 MiB, 7.43% gc time, 141.16% compilation time)

if we make the following change:

diff --git a/src/PrettyTables.jl b/src/PrettyTables.jl
index a39444d..5fb57d7 100644
--- a/src/PrettyTables.jl
+++ b/src/PrettyTables.jl
@@ -103,6 +103,7 @@ if Base.VERSION >= v"1.4.2" && !haskey(ENV, "PRETTY_TABLES_NO_PRECOMPILATION")
         _precompile_()
     catch
     end
+    pretty_table(devnull, Dict(:a=>rand(UInt8, 10), :b=>rand(Float64, 10)))
 end

 end # module

we get:

julia> using PrettyTables

julia> @time @eval pretty_table(devnull, Dict(:a=>rand(10), :b=>rand(Float32, 10)))
  0.468314 seconds (929.76 k allocations: 59.503 MiB, 10.62% gc time, 141.03% compilation time)

Notice we use different types here to show the precompiled stuff is transferable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions