jesseduffield.lazygit/pkg
Stefan Haller 26132cf5bd Use utils.StringWidth to optimize rendering performance
runewidth.StringWidth is an expensive call, even if the input string is pure
ASCII. Improve this by providing a wrapper that short-circuits the call to len
if the input is ASCII.

Benchmark results show that for non-ASCII strings it makes no noticable
difference, but for ASCII strings it provides a more than 200x speedup.

BenchmarkStringWidthAsciiOriginal-10            718135       1637 ns/op
BenchmarkStringWidthAsciiOptimized-10        159197538          7.545 ns/op
BenchmarkStringWidthNonAsciiOriginal-10         486290       2391 ns/op
BenchmarkStringWidthNonAsciiOptimized-10        502286       2383 ns/op
2024-06-23 13:10:48 +02:00
..
app Add -profile command line flag 2024-06-03 19:07:24 +02:00
cheatsheet Render keybinding cheatsheet as markdown table 2024-01-28 08:12:01 +11:00
commands Fix custom patch operations on added files 2024-06-23 12:40:31 +02:00
common Add AppState to common.Common 2023-09-04 17:48:39 +02:00
config Add user config gui.commitAuthorFormat 2024-06-15 10:39:50 +04:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
gui Use utils.StringWidth to optimize rendering performance 2024-06-23 13:10:48 +02:00
i18n Always show the "Discard unchanged changes" menu item 2024-06-23 12:43:34 +02:00
integration Show radio buttons in the sort order menu for branches 2024-06-23 12:53:15 +02:00
jsonschema Fix boolean config keys not appearing in the generated Config.md 2024-05-31 20:07:58 +02:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
tasks Use ScanLinesAndTruncateWhenLongerThanBuffer instead of bufio.ScanLines 2024-05-15 13:27:01 +02:00
theme pkg: fix some comment 2024-04-07 16:09:26 +08:00
updates Construct arg vector manually rather than parse string 2023-05-23 19:49:19 +10:00
utils Use utils.StringWidth to optimize rendering performance 2024-06-23 13:10:48 +02:00