Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more wholistic precompilation workload #196

Open
Moelf opened this issue Jan 3, 2023 · 2 comments
Open

Adding more wholistic precompilation workload #196

Moelf opened this issue Jan 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Moelf
Copy link

Moelf commented Jan 3, 2023

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.

@ronisbr
Copy link
Owner

ronisbr commented Jan 4, 2023

Thanks @Moelf ! I will research a little to check how we can use this new feature. Last time I checked, I could drastically reduce the TTFP, but the package loading time was much higher.

@ronisbr ronisbr added the enhancement New feature or request label Jun 30, 2023
@ronisbr
Copy link
Owner

ronisbr commented Nov 6, 2023

Hi @Moelf !

I switched to PrecompilationTools.jl (in master). Can you please check if things were improved for you?

Here, the TTFP is very low for your type:

julia> using PrettyTables

julia> @time pretty_table(devnull, Dict(:a=>rand(10), :b=>rand(Float32, 10)))
  0.068245 seconds (94.32 k allocations: 6.304 MiB, 96.88% compilation time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants