From 2f51baa2d843e87cb28fb9e2100bda5bcb7f31f6 Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 22 Oct 2023 11:17:51 +0800 Subject: [PATCH] Precompile terminfo loading and the Banner This improves startup latency, a neded improvement now that startup is a bit fancier. --- base/client.jl | 2 +- stdlib/REPL/src/precompile.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index f570a70422253..44c4676a04883 100644 --- a/base/client.jl +++ b/base/client.jl @@ -590,7 +590,7 @@ function repl_main(_) banner = if opts.banner == -1 10 * Int(interactiveinput) else - opts.banner + Int(opts.banner) end quiet = (opts.quiet != 0) history_file = (opts.historyfile != 0) diff --git a/stdlib/REPL/src/precompile.jl b/stdlib/REPL/src/precompile.jl index 7b4a1c4710292..6b66e0cfbe4ec 100644 --- a/stdlib/REPL/src/precompile.jl +++ b/stdlib/REPL/src/precompile.jl @@ -32,11 +32,14 @@ UP_ARROW = "\e[A" DOWN_ARROW = "\e[B" repl_script = """ +Base.load_terminfo("xterm") 2+2 print("") printstyled("a", "b") display([1]) display([1 2; 3 4]) +import REPL.banner +banner() foo(x) = 1 @time @eval foo(1) ; pwd