Skip to content

Commit

Permalink
fixes #764 Adding tcell as a dependency delays startup time
Browse files Browse the repository at this point in the history
We no longer bother to create the lookup table for runewidth.
I had expected this to make a significant difference, but I'm
finding that it does not, but it does make the startup time even
for applications that only import and never create a screen,
considerably worse.  Dozens of milliseconds, even up to half a
second.

Applications that need this (persumably some heavy Emoji or
EastAsian users) can solve for themselves by importing the runewidth
package (same version) and calling the CreateLUT method.
  • Loading branch information
gdamore committed Jan 9, 2025
1 parent 807ae5d commit 522d1e6
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,4 @@ func init() {
if os.Getenv("RUNEWIDTH_EASTASIAN") == "" {
runewidth.DefaultCondition.EastAsianWidth = false
}

// For performance reasons, we create a lookup table. However, some users
// might be more memory conscious. If that's you, set the TCELL_MINIMIZE
// environment variable.
if os.Getenv("TCELL_MINIMIZE") == "" {
runewidth.CreateLUT()
}
}

0 comments on commit 522d1e6

Please sign in to comment.