Go Lang: gomobile bind optimize code built for armv7-a and arm64-v8a

148 Views Asked by At

I am struggling to build Go Lang into .so with binding to AAR file.

This is code I use for building

    CGO_ENABLED=1 \
        gomobile bind \
        -target=android/arm \
        -ldflags="-w -s" \
        -o export.aar \
        -v

My goal is to speedup **Go Lang **code I have. I can't share code, nor discuss what it does.

Processing of same code on i7: 6 CPU, 12vCPU takes 100ms
While on ARMv7, 2GB ram, Android 9: 4-5 sec.

I tried lots of things, like making code single threaded, instead of multi threaded as it is now, didn't help.

Are there any optimizations which I can enable just for ARM CPU-us?

I want to try -ffast-math. I tried on C++ code which I have as dependency .so libs, didn't helped.

P.S. I just thought about go build -gcflags '-m' checking which variables escape from stack to heap. I am not sure how good would be if I figure out which variables to fix, if fix is posible.

0

There are 0 best solutions below