How to profile on Android? #6120
Unanswered
MaxGyver83
asked this question in
Q&A
Replies: 2 comments 2 replies
-
|
I cound find a way: Create a global variablevar (
prof interface{ Stop() }
)Start the profilerfunc main() {
prof = profile.Start(profile.ProfilePath("/sdcard/Download/"))
a = app.New()Stop the profiler manually on a button click myButton.OnTapped = prof.StopCopy the file over to my laptop$ adb pull /sdcard/Download/cpu.pprofProfiler output$ go tool pprof -top ./cpu.pprof
...
Duration: 36.08s, Total samples = 23.53s (65.21%)
Showing nodes accounting for 19.51s, 82.92% of 23.53s total
Dropped 581 nodes (cum <= 0.12s)
flat flat% sum% cum cum%
2.72s 11.56% 11.56% 10.04s 42.67% golang.org/x/image/vector.(*Rasterizer).rasterizeOpOver
1.57s 6.67% 18.23% 1.57s 6.67% [libc.so]
1.22s 5.18% 23.42% 1.22s 5.18% [libart.so]
1.14s 4.84% 28.26% 1.17s 4.97% runtime.cgocall
1.07s 4.55% 32.81% 1.07s 4.55% runtime.futex
0.98s 4.16% 36.97% 1.01s 4.29% image/draw.drawNRGBAOver
0.90s 3.82% 40.80% 1.70s 7.22% runtime.mallocgcTiny
0.81s 3.44% 44.24% 0.81s 3.44% image/color.NRGBA.RGBA
0.78s 3.31% 47.56% 1.33s 5.65% image/color.nrgbaModel
0.75s 3.19% 50.74% 2.45s 10.41% image.(*NRGBA).Set
0.66s 2.80% 53.55% 2.87s 12.20% runtime.mallocgc
0.62s 2.63% 56.18% 0.79s 3.36% image.(*NRGBA).NRGBAAt
0.51s 2.17% 58.35% 3.04s 12.92% runtime.convTnoptr
0.50s 2.12% 60.48% 0.64s 2.72% golang.org/x/image/vector.(*Rasterizer).floatingLineTo
0.44s 1.87% 62.35% 0.44s 1.87% golang.org/x/image/vector.floatingAccumulateMask (inline)
0.32s 1.36% 63.71% 0.33s 1.40% runtime.nextFreeFast (inline)
0.29s 1.23% 64.94% 0.29s 1.23% [libGLES_mali.so]
... |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
To find out a writable location use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I try to write a Markdown viewer for Android with Fyne. So far, it's super slow: After selecting a folder and clicking the "grant permission" button, it takes about 10 seconds to display the rendered file content (of the first file in the folder). (10 seconds is for a release build using Fyne's develop branch.) On the desktop (Linux), a Markdown file is displayed instantly.
I have tried to profile the app with "github.com/pkg/profile". This works on Linux but on Android I don't know how to use it.
When I set no profile path, I can't find the profile file. I guess it's in the app's data folder which I can't access (because my device is not rooted).
When I set an accessible directory, the app hangs right after starting (I see only the large icon):
Am I using the wrong tool? Or just the wrong profile path? How do you profile Fyne apps on Android?
Update:
I think the problem was that
/storage/self/primary/Download/cpu.pprofalready existed. After deleting it, I could start my app and a newcpu.pprofwas created. But the new file has a size of 0 bytes. Maybe this error is related!?Beta Was this translation helpful? Give feedback.
All reactions