automotive-design-compose icon indicating copy to clipboard operation
automotive-design-compose copied to clipboard

Convert the Layout crate and JNI to use Protobuf

Open timothyfroehlich opened this issue 1 year ago • 1 comments

timothyfroehlich avatar May 16 '24 17:05 timothyfroehlich

Snapshot diff report vs base branch: main Last updated: Thu May 23 14:24:11 PDT 2024, Sha: ae77719b3977953015ce8c7c35b12916fed2ed9f No differences detected

github-actions[bot] avatar May 16 '24 18:05 github-actions[bot]

Does the squoosh config run the same as before? (I saw that you made some changes to LayoutManager; squoosh uses the LayoutParentChildren type to get the tree communicated, rather than the subscribe/unsubscribe methods).

iamralpht avatar May 21 '24 00:05 iamralpht

The Validation test passes and there's no changes in screenshots, if that's what you mean.

On Mon, May 20, 2024 at 7:41 PM Ralph Thomas @.***> wrote:

Does the squoosh config run the same as before? (I saw that you made some changes to LayoutManager; squoosh uses the LayoutParentChildren type to get the tree communicated, rather than the subscribe/unsubscribe methods).

— Reply to this email directly, view it on GitHub https://github.com/google/automotive-design-compose/pull/1119#issuecomment-2121490239, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMM2SRBUMDPVQAJABKPP7LZDKJ5BAVCNFSM6AAAAABH2VSBWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRRGQ4TAMRTHE . You are receiving this because you were assigned.Message ID: @.***>

-- Tim Froehlich Test Engineer for DesignCompose and AAOS Located in Austin TX, US Central Time I support a free Palestine 🇵🇸 - go/open-letter

timothyfroehlich avatar May 21 '24 14:05 timothyfroehlich

@rylin8 I've not tried to measure performance of this change. If @iamralpht wants me to then I absolutely can, it'll just take more time. Do you have any benchmarking tests written for the rust code?

It's definitely less efficient to go serdeclass -> protoclass -> serialize... etc. I chose that for this change because this change is only a partial conversion of our structures that are serialized. I'll look back into whether we want to stay with wrapping the classes or just replace the Rust-native classes with the protobuf-generated classes when I finish the proto files for all of serializedDesignDoc.

timothyfroehlich avatar May 22 '24 18:05 timothyfroehlich

It's definitely less efficient to go serdeclass -> protoclass -> serialize... etc. I chose that for this change because this change is only a partial conversion of our structures that are serialized. I'll look back into whether we want to stay with wrapping the classes or just replace the Rust-native classes with the protobuf-generated classes when I finish the proto files for all of serializedDesignDoc.

If you want some numbers, even spitball comparisons, you can instrument this one function in Squoosh: https://github.com/google/automotive-design-compose/blob/main/designcompose/src/main/java/com/android/designcompose/squoosh/SquooshLayout.kt#L52

That includes the serialize, deserialize, and layout algo runtime over the whole tree. In the traditional DC implementation it's a bit harder to capture all the phases because the callsites are spread out (like serialize is in with subscribe which is called during composition, for example).

iamralpht avatar May 22 '24 20:05 iamralpht