Skip to content

Comments

Move _select encoding and decoding to threads.#33

Closed
noamraph wants to merge 1 commit intoQuisApp:masterfrom
noamraph:encode-on-thread
Closed

Move _select encoding and decoding to threads.#33
noamraph wants to merge 1 commit intoQuisApp:masterfrom
noamraph:encode-on-thread

Conversation

@noamraph
Copy link

This includes 3 separate changes:

  1. In FlutterContactsPlugin.kt, encode the _select results in the same thread in which fetching is done, instead of on the main thread.
  2. In flutter_contacts.dart, decode on a separate dart isolate.
  3. In example/main.dart, start fetching the contacts after the user presses the button.

There is still non-responsiveness. I think it's shorter.

The change in FlutterContactsPlugin.kt is reasonable - it just follows the implementation of MethodCallHandler, which is pretty small.

The change in flutter_contacts.dart is pretty ugly. I'm really not sure it's worth it.

The change in example/main.dart was useful because it allowed me to start profiling and then press the button.

I send this mostly as reference. If I were the maintainer, I would see how much the change in FlutterContactsPlugin.kt shortens the non-responsive time, and decide if it's worth the (not too big) added complexity. I would not merge the change in flutter_contacts.dart.

I hope this helps,
Noam

@aytunch
Copy link

aytunch commented Nov 30, 2023

Hi, I know this PR is old, but it could help the Android performance a lot for devices which have many contacts.
Will this be worked on any time soon? Thanks.

@joachim-quis
Copy link
Contributor

Important Notice: Repository Reset for v2.0

This repository is being reset for a complete v2.0 rewrite of flutter_contacts. The existing v1 codebase and full git history will be preserved in the legacy_v1 branch.

What this means for your PR:

  • This PR will become unmergeable after the reset
  • If your change is a feature or fix that's still relevant for v2, please review the new codebase after the migration and consider re-implementing it against the new main branch

Note that v2 is a complete rewrite with many new features including full macOS support, comprehensive vCard import/export, SIM contacts, contact groups, account management, blocked numbers, ringtone assignment, and more. This PR may already be addressed in v2.

Thank you for your contribution, and apologies for the inconvenience!

@joachim-quis joachim-quis deleted the branch QuisApp:master January 21, 2026 03:54
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.

3 participants