Remove protobuf dependency - #96
Open
h-sumiya wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.protoschemas and protobuf code generation workflow.Motivation
The native bridge only exchanges five fixed message types, so using a general-purpose protobuf runtime introduced unnecessary dependency, reflection, allocation, and decoding overhead.
The new codecs implement only the wire fields required by the bridge. This keeps the existing behavior and native binary compatibility while reducing runtime overhead and removing the protobuf dependency entirely.
No new project dependencies were added.
Compatibility
The bridge wire representation remains compatible with the existing Android, iOS, macOS, Linux, and Windows native artifacts.
The existing model names, constructors, and fields remain available, so application-facing encoding and decoding APIs are unchanged.
Native compatibility was verified using the bundled Linux library for:
Performance
A local before-and-after benchmark using a 1 MiB frame over 200 iterations produced the following results:
The deserialization improvement primarily comes from avoiding the protobuf runtime and returning a zero-copy view of frame payloads.
Validation
flutter test— 5 Dart codec tests passeddart analyze lib/models test/wire_format_test.dart— no issuesflutter analyzeforflutter_avif_web— no issuesflutter analyze lib testforflutter_avif— completed with existing informational lints only