-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add a composition tracing sample #212
Comments
Passing this over to @bentrengrove for evaluation. |
Are you after a sample that would show Composable functions in a macrobenchmark trace? I think if we just add the dependency to the macrobenchmark sample, it should work. |
You also need to enable the flag that turns on composition tracing: https://developer.android.com/topic/performance/benchmarking/macrobenchmark-instrumentation-args#fulltracing This is off by default for now since it doesn't support tracing during cold startups (which is being worked on), and because overhead was a concern (though several optimizations have landed since). |
This sounds like it would be a good sample then! I can do this |
Perfect. It mostly that. But also a forcing function to see a proper project setup with the dependencies and proguard rules. |
Contrary to https://developer.android.com/jetpack/compose/tooling/tracing I don't think you need these in your app as a implementation dependency. https://github.com/google/horologist/pull/1209/files
|
This was a nice win of the composition tracing, showing composition counts
|
@bentrengrove Any updates on adding composition tracing example? I tried adding the dependencies and enabled the required flags as per the documentation, but it is not working. |
What is the stacktrace? |
@yschimke Here's the stacktrace:
I have done the set up similar to the horologist project which seems to be contrary to what the documentation says about adding the tracing dependencies. Shouldn't they be added into Macrobenchmark module and not in the app module? Here's my branch if you want to try it out. |
I think the docs are wrong. I've added it to the app module and it works. The section above for capturing for the command line also says add to the app. https://developer.android.com/jetpack/compose/tooling/tracing#terminal |
Now it's really confusing. I added in the app module and it fails with the error mentioned above. I wanted to explore the Compose traces from Macrobenchmark tests and having a sample for apps would surely help here. Not to mention that having a single source of truth would benefit everyone! I have created a separate issue in horologist to reduce unnecessary noise here. |
Hm, this is what eng for tracing recommended doing for Macrobenchmark. |
Yes, I tried the recommended approach as well and still it is not working. Maybe something is in the documentation? |
It's temporarily broken with some workarounds https://issuetracker.google.com/issues/286228781 And I need to update the Horologist samples after this lands tomorrow. |
All the issues with versions and compatibility issues should be resolved by now by using latest versions of the libraries. Thanks for the report! |
@mlykotom should this be closed? I'd expect a gradle file with |
I haven't added this to the gradle file as some benchmarks might not work properly. |
Add a composition tracing sample, particularly with macrobenchmark.
https://developer.android.com/jetpack/compose/performance/tracing
The text was updated successfully, but these errors were encountered: