You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
}
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: