Super slow comparing RealmResults
See original GitHub issueI got some list of object from database:
newSubscribedEpisodes = realm.where(Episode.class).equalTo("isNew", true).sort("publishedDate", Sort.DESCENDING).findAll();
There is about 1100 results.
I check if those results are in the other list (about 1000 elements):
for (Episode episode : newSubscribedEpisodes) {
KLog.d(podcast + " " +episode + " pol");
KLog.w(episodes.contains(episode) + " pol");
}
And it takes about 10 seconds. But when I do a copy of the realm results list it takes 0,5s.
realm.copyFromRealm(newSubscribedEpisodes)
It could be a walkaround but for bigger lists I get OOM for copyFromRealm().
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Recyclerview is so slow with a lot of item - Stack Overflow
I have made this code that could retrieve from realm 50k items and show it in recyclerview: final RealmResults<AirportR> airps ...
Read more >The things I've learned using Realm | by Gabor Varadi - Medium
I've been working on a way to expose RealmResults in an observable manner from a handler thread, either copying the dataset, mapping the...
Read more >Realistic Realm - lessons learned after using it for 1.5 years
This can be very slow, so MVCC takes a different approach: each user connected to the database sees a snapshot of the database...
Read more >Analysis and quantitative comparison of storage ... - DiVA Portal
databases to compare performance in CRUD operations when using a very simple ... representation of the relation between Core Data and Realm results...
Read more >070: An honest discussion about Realm - Fragmented Podcast
You can use SQL incorrectly and make it slow. On the flip side, you can optimize the various SQL ORMs to be very...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
can’t you extract only the episodes ids from RSS then use
not in
to discriminate episodes in Realm which are not from the RSS feed, this way you don’t have tocopyFromRealm
or iterate theRealmResults
to do the comparison outsideSomething like
Above solution seems to have worked. Closing