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

Improve performance by switching method channels to generated pigeon code. #743

Open
panmari opened this issue Feb 6, 2025 · 3 comments
Assignees

Comments

@panmari
Copy link
Contributor

panmari commented Feb 6, 2025

Describe your issue. If applicable, add screenshots to help explain your problem.

See https://pub.dev/packages/pigeon. This would in particular help with performance of #732. Plus it simplifies code by depending on code generation.

Steps to reproduce.

N/A

What is the expected result?

N/A

Did you try our example app?

Yes

Is it reproducible in the example app?

Yes

Reproducible in which OS?

iOS and Android

Flutter/Dart Version?

No response

Plugin Version?

Most recent in tree.

@bensonarafat bensonarafat self-assigned this Feb 24, 2025
@bensonarafat
Copy link
Collaborator

I don't know how this sounds with @fbernaly
If it is okay, I can add the feature

@fbernaly
Copy link
Collaborator

@panmari: take this package: https://github.com/flutter-ml/google_ml_kit_flutter/tree/develop/packages/google_mlkit_commons and work on those changes I would like to see how it looks and then we will see if we implement it for the rest of the plugins.

@fbernaly fbernaly assigned panmari and unassigned bensonarafat Mar 11, 2025
@panmari
Copy link
Contributor Author

panmari commented Mar 11, 2025

I looked into how much work this is for the image labeling plugin. It's unfortunately a considerable amount of work to get this done, see my (incomplete) attempt at https://github.com/flutter-ml/google_ml_kit_flutter/compare/develop...panmari:Google-Ml-Kit-plugin:pigeon?expand=1.

One of the really nice things: Having multiple instances becomes really easy, because pigeon supports setting a channel suffix:

  factory ImageLabeler({required ImageLabelerOptions options, String identifier = ''}) {
    api = ImageLabelDetectorApi(messageChannelSuffix: identifier);
    api.create(options);
  }

So a lot of the custom logic for handling multiple models at once could be deleted (if I understand the model correctly)

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

No branches or pull requests

3 participants