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

How to improve performance on large datasets ? #39

Open
Venkata-Maniteja opened this issue Jul 17, 2020 · 4 comments
Open

How to improve performance on large datasets ? #39

Venkata-Maniteja opened this issue Jul 17, 2020 · 4 comments

Comments

@Venkata-Maniteja
Copy link

Venkata-Maniteja commented Jul 17, 2020

Hi,

I'm using unrealm to support structs as realm objects. However this comes with a performance hit.

I observed few things. LEts say there are 10k records in realm.

Reading the results from realm is pretty quick, its less than a second for those 10k items.

And when I try to convert them into an array, it becomes too slow. It is only converting 100 items per second into an array, so for 10k items, it is taking 100secs.

Do you recommend any solution to improve the loading speed ?

NOTE: I want to convert the realm results into an array because , I cant use predicates on structs. If I use class, I loose the swift features on struct.

Sample code:

        extension Task {
              static func all() -> Results<Task>? {
                    if let realm = try? Realm() {
                          return realm.objects(Task.self)
                    }
                     return .none
              }
        }
        if let tasks = Task.all() {
            DataManager.shared.tasks = Array(tasks)
        }
@arturdev
Copy link
Owner

I'm already working on some optimization/caching the schemes which seem take a long time/.
Will release a new version in a few days.

@DanBurkhardt
Copy link

@arturdev was this enhancement ever released?

Thanks,
Dan

@mladjan
Copy link

mladjan commented Nov 8, 2020

Is there any updates on this topic?

@HKdAlex
Copy link

HKdAlex commented Dec 25, 2020

Would be interesting to know if there has been some development.

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

5 participants