Term.jl
Term.jl copied to clipboard
Lower TTFX(Time to first X) time by shifting more things to precompilation
Hello. Thanks for the awesome project. I've been using it for a while and I was wondering if one can do something about TTFX times for REPR, Errors and Logs. More specifically, I wonder if we can shift more things to precompilation via a new package which got released recently https://discourse.julialang.org/t/ann-new-package-snoopprecompile/84778
Hey thanks for suggesting that.
I've added
using SnoopPrecompile
@precompile_setup begin
@precompile_all_calls begin
Panel()
Panel("test") * Panel(Panel()) / hLine(20)
end
end
julia> @time using Term
[ Info: Precompiling Term [22787eb5-b846-44ae-b979-8e399b8463ab]
6.172189 seconds (2.07 M allocations: 114.463 MiB, 0.63% gc time, 8.67% compilation time: 99% of which was recompilation)
to Term.jl
and it increased the compilation time from 0.2 to 6 seconds (on my machine), but then:
julia> @time Panel()
1.646217 seconds (3.80 M allocations: 204.119 MiB, 13.22% gc time, 99.90% compilation time: 3% of which was recompilation)
I think I don't understand how to use pre-compilation directly, any pointers?
@FedeClaudi Hey. Thats odd. Can I open a topic on Zulip for this? People there are much better at troubleshooting this stuff
Also, is that on Julia 1.8?
yeah of course that'd be great. Yeah I tried on Julia1.8
@FedeClaudi It would also be helpful if there was a branch or a PR I could try to troubleshoot this :sweat_smile:
Hi,
You can just try adding
using SnoopPrecompile
@precompile_setup begin
@precompile_all_calls begin
Panel()
Panel("test") * Panel(Panel()) / hLine(20)
end
end
to Term.jl
, this is all I've tried so far
Here's what I see.
@FedeClaudi That reminds me, here's the link to the Zulip topic. There's some constructive feedback in there as well. https://julialang.zulipchat.com/#narrow/stream/225542-helpdesk/topic/Lowering.20TTFX.20in.20Term.2Ejl