Speed up gh start up time (#7487)
The tcell library has an `init()` block where it performs some very expensive indexing that takes 30-40 ms on my machine. This results in fixed overhead for every gh invocation, even for commands that don't use tcell at all. This sets an environment variable that instructs tcell to avoid doing that.
This commit is contained in:
parent
b292dc43b2
commit
8741b648a6
1 changed files with 8 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package build
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
|
|
@ -16,4 +17,11 @@ func init() {
|
|||
Version = info.Main.Version
|
||||
}
|
||||
}
|
||||
|
||||
// Signal the tcell library to skip its expensive `init` block. This saves 30-40ms in startup
|
||||
// time for the gh process. The downside is that some Unicode glyphs from user-generated
|
||||
// content might cause mis-alignment in tcell-enabled views.
|
||||
//
|
||||
// https://github.com/gdamore/tcell/commit/2f889d79bd61b1fd2f43372529975a65b792a7ae
|
||||
_ = os.Setenv("TCELL_MINIMIZE", "1")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue