Aleon Q
03/16/2022, 7:42 PMText
composable in TextBasicBenchmark that uses ComposeBenchmarkRule. It uses a few methods that benchmarks the first composition, measure, draw, layout. The problem I am running into is what how would I be able to use that ComposeBenchmarkRule? I couldnt find any dependencies/library that exposes this class. Is this currently available for use in any jetpack compose testing libraries? How should I go about it?
Thanks for creating this space and allowing the questions to be asked. Much appreciated 🙌Ben Trengrove [G]
03/16/2022, 11:10 PMAleon Q
03/17/2022, 12:32 AMBen Trengrove [G]
03/17/2022, 12:51 AMAleon Q
03/17/2022, 12:56 AMComposeBenchmarkRule
to my benchmark project and make some adjustments to gradle and copied code to make it compile. After some failed to compile or run iterations, I was able to benchmark a Composable. Still continuing on this path.
It works, in that it logs out the benchmark stats for the tests that I wrote but I am not sure if what I did is the correct way for the two reasons:
• Is there an easier way that I may have overlooked entirely
• Is this still the correct way after I ported over the code and made some adjustments to make it compile and run
I must say that I really appreciate:
• That the code is all open to be looked at, to learn from
• Most of the error messaging that I encountered during this exercise were right on the money because of which I was able to make some the adjustments that I did
Looking forward to some inputs /direction from the team on this.
Edit: Edited “errors” to “error messaging” in the last bullet point.Chuck Jazdzewski [G]
03/17/2022, 6:39 PMBen Trengrove [G]
03/17/2022, 8:56 PMAleon Q
03/18/2022, 2:23 PMcomposables
I wrote based on the points that I mentioned above. I made an aar
out of the few classes taken out of the classes that I needed in compose’s repo (involving around ComposeBenchmarkRule
) so that I wont have to copy over the classes of interest for every project that I want to use these type of benchmarks on. It seem to do the trick for me.
Also, I stumbled upon this thread where Leland and you very succinctly painted what performance improvement is.. glad to have found it..
That is so nice of you, thanks @Ben Trengrove [G] for creating the feature request. I just starred it. Hope it gets picked up by the team and be of value to others in the community as well.
🙌 🙌