Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text/cmd/gotext: update command too slow #49039

Open
linggao opened this issue Oct 18, 2021 · 3 comments
Open

x/text/cmd/gotext: update command too slow #49039

linggao opened this issue Oct 18, 2021 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Milestone

Comments

@linggao
Copy link

linggao commented Oct 18, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/go/src/github.com/open-horizon/anax/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build538988283=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Ran the following command:
$GOPATH/bin/gotext -srclang=en update -out=i18n_messages/catalog.go -lang=en,zh_CN,zh_TW,fr,de,it,ja,pt_BR,es,ko 2>&1
It took between 30 to 40 minutes on my vm that has 8G memory, 2.1GH dual CPU and 100G disk space.
There are about 2000 messages need to be translated in the code. 9 languages + english.
Here is our repo: https://github.com/open-horizon/anax

What did you expect to see?

We expect this should be finished within a few minutes.

What did you see instead?

It takes 30 to 40 minutes.

@seankhliao seankhliao changed the title gotext update command too slow x/text/cmd/gotext: update command too slow Oct 18, 2021
@gopherbot gopherbot added this to the Unreleased milestone Oct 18, 2021
@cherrymui cherrymui added Performance NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 18, 2021
@cherrymui
Copy link
Member

cc @mpvl

@remko
Copy link

remko commented Dec 20, 2021

I am also experiencing extremely slow updates. I just started using gotext, so I can't say if this is a regression or not, but it happens on all my machines (running macOS, go 1.16)

My project is tiny (only one string), but has many dependencies. Running gotext update takes about 2 minutes on a MacBook pro 3.5Ghz dual core i7. I can't tell what it does, but I see lots of clang invocations, so it seems to be compiling a lot of things every time go generate is called.

@diamondburned
Copy link

I can confirm that this is also happening with my gotk4 projects. I'm guessing that go/ssa somehow does not use the Cgo build cache that go build does, but instead completely rebuilds it from scratch every single time it's invoked. The extraction time is about as long as the cold Cgo build time but slightly longer, which in my case is about 10 minutes or so, and I can see the cmd/cgo invocations in htop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Projects
None yet
Development

No branches or pull requests

5 participants