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/mobile: gomobile bind takes too long #28096

Open
vickyramachandra opened this Issue Oct 9, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@vickyramachandra

vickyramachandra commented Oct 9, 2018

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

go version go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/Documents/Freshdesk/golang"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y8/ylh63k1106ldg8t7q3jrl701s3tf0r/T/go-build694332607=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I use gomobile for building .aar and .framework for Android and iOS respectively. The gomobile bind -target=android/ios usually takes about 10 to 15 seconds. But off late, the process easily takes more than 3 minutes

What did you expect to see?

Less build time (~10 to 15 secs)

What did you see instead?

Too long (> 3 mins)

@gopherbot gopherbot added this to the Unreleased milestone Oct 9, 2018

@gopherbot gopherbot added the mobile label Oct 9, 2018

@vickyramachandra

This comment has been minimized.

vickyramachandra commented Oct 9, 2018

@eliasnaur

This comment has been minimized.

Contributor

eliasnaur commented Oct 9, 2018

What's the steps for reproducing the problem?

@vickyramachandra

This comment has been minimized.

vickyramachandra commented Oct 10, 2018

Just get the latest version of gomobile by go get golang.org/x/mobile/cmd/gomobile and gomobile init. Now try to run the command on a sample.go

@eliasnaur

This comment has been minimized.

Contributor

eliasnaur commented Oct 10, 2018

I can't reproduce the problem. I made a trivial change to example/bind/hello/hello.go to avoid caching and ran

$ time gomobile bind golang.org/x/mobile/example/bind/hello

real	0m8,942s
user	0m7,954s
sys	0m2,384s

and it completed in under 10 seconds.

Note that because of the new cmd/go caching in Go 1.10 (and 1.11) the first gomobile bind probably takes quite a while.

@vickyramachandra

This comment has been minimized.

vickyramachandra commented Oct 10, 2018

Hey Elias,
First time when i ran it for example/bind/hello/hello.go, i got the following

 real	1m56.577s
 user	0m28.475s
 sys	0m11.957s

and the subsequent one showed this

 real	1m37.963s
 user	0m9.844s
 sys	0m7.439s
@eliasnaur

This comment has been minimized.

Contributor

eliasnaur commented Oct 10, 2018

I don't know why, sorry. It's suspicious that real time is more than a minute yet so little time is spent in user and kernel mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment