Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

StrictMode for detecting queries on the main thread #66

Open
JakeWharton opened this issue Oct 2, 2015 · 0 comments
Open

StrictMode for detecting queries on the main thread #66

JakeWharton opened this issue Oct 2, 2015 · 0 comments
Labels

Comments

@JakeWharton
Copy link
Collaborator

StrictMode is lazy and only detects slow queries on the main thread. This is mostly useless since the query execution time is subjective based on the data in the DB and CPU/disk performance of the device.

There's a few options here:

  • Inform StrictMode via noteSlowCall and allow normal penalties to apply. This sucks because there's no granularity between those posting to this method and puts the subjectiveness of what's slow into the libraries. There would be no way to enable slow call penalties from one library but disable it from another. Granted, this is unlikely.
  • Add our own strict mode analogous which allowed the detection of queries running on the UI thread.
  • Provide a composition point for either observable creation or query object creation. This would allow someone to mix in things like main thread checking, or perhaps default schedulers.

This isn't urgent, so we have time to think about what's most appropriate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant