I have filtered query, which returns about 220 items with 8 fields each without child nodes. It's not tiny portion of data, but definately not the large one. On the pic below the following happens:
I've seen some top process in debugger: FirebaseDatabaseWorker. Looks like it does some loaded data processing. But 1 minute with 30%CPU?? Is it possible to optimize?
Thanks!
final DatabaseReference artRef =
database.getReference("sales/"+store+"/articles");
Query query = artRef.orderByChild("familyId").equalTo(familyId);
query.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
for (DataSnapshot child : snapshot.getChildren()) {
Article article = child.getValue(Article.class);
article.id = Integer.parseInt(child.getKey());
articles.add(article);
}
adapter.notifyDataSetChanged();
}
Disabling Instant Run in Android Studio made it from 1 minute to about 5 second to call onDataChange.