Skip to content
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

Convert the Layout crate and JNI to use Protobuf #1119

Merged
merged 9 commits into from
May 23, 2024

Conversation

timothyfroehlich
Copy link
Member

No description provided.

Copy link

github-actions bot commented May 16, 2024

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

@timothyfroehlich timothyfroehlich marked this pull request as ready for review May 16, 2024 19:46
@iamralpht
Copy link
Collaborator

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).

@timothyfroehlich
Copy link
Member Author

timothyfroehlich commented May 21, 2024 via email

@timothyfroehlich
Copy link
Member Author

@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.

@iamralpht
Copy link
Collaborator

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).

@timothyfroehlich timothyfroehlich added this pull request to the merge queue May 23, 2024
Merged via the queue into main with commit 49af626 May 23, 2024
20 checks passed
@timothyfroehlich timothyfroehlich deleted the wb/froeht/protobuf-4 branch May 23, 2024 21:54
@timothyfroehlich timothyfroehlich linked an issue May 29, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert the Layout crate and JNI to use Protobuf
3 participants