Skip to content

Commit ea904f3

Browse files
stevenchen-dbIsaac
andauthored
Upgrade go-runewidth to v0.0.31 to cut CLI startup time (#7391)
## Changes Upgrade the indirect dependency `github.com/mattn/go-runewidth` from v0.0.27 to v0.0.31. v0.0.26 and v0.0.27 build a 2.2 MB rune-width lookup table in `init()`, which adds ~30ms to every CLI invocation before any command runs. v0.0.31 builds it lazily on first use. ## Tests - `GODEBUG=inittrace=1`: runewidth init 30ms → 0.02ms. - `databricks --version` median of 21 runs: 55.1ms → 22.3ms. - Unit tests for all packages that depend on runewidth pass. The full acceptance suite shows no differences from `main` locally. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
1 parent b61373f commit ea904f3

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Upgrade `github.com/mattn/go-runewidth` to v0.0.31, which removes ~30ms of startup time from every command. ([#7391](https://github.com/databricks/cli/pull/7391))

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ require (
7979
github.com/kr/text v0.2.0 // indirect
8080
github.com/lucasb-eyer/go-colorful v1.4.1 // indirect
8181
github.com/mattn/go-localereader v0.0.1 // indirect
82-
github.com/mattn/go-runewidth v0.0.27 // indirect
82+
github.com/mattn/go-runewidth v0.0.31 // indirect
8383
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
8484
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
8585
github.com/muesli/cancelreader v0.2.2 // indirect

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsRe
130130
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
131131
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
132132
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
133-
github.com/mattn/go-runewidth v0.0.27 h1:Feg/Oou5zI/wnpgDF6omIU0OokC9GxLC/WRknhVlIR0=
134-
github.com/mattn/go-runewidth v0.0.27/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
133+
github.com/mattn/go-runewidth v0.0.31 h1:1oCV4ReTlosDBc6rYRw5cL8S/4y8iv5oRl4SJ5IBgwo=
134+
github.com/mattn/go-runewidth v0.0.31/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
135135
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
136136
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
137137
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=

0 commit comments

Comments
 (0)