ndb: switch to nostrdb notes
This is a refactor of the codebase to use a more memory-efficient representation of notes. It should also be much faster at decoding since we're using a custom C json parser now. Changelog-Changed: Improved memory usage and performance when processing events
This commit is contained in:
@@ -33,17 +33,8 @@ class ProfileModel: ObservableObject, Equatable {
|
||||
guard let contacts = self.contacts else {
|
||||
return false
|
||||
}
|
||||
|
||||
for tag in contacts.tags {
|
||||
guard tag.count >= 2,
|
||||
tag[0].matches_char("p"),
|
||||
tag[1].matches_str(pubkey)
|
||||
else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
return contacts.referenced_pubkeys.contains(pubkey)
|
||||
}
|
||||
|
||||
func get_follow_target() -> FollowTarget {
|
||||
@@ -77,7 +68,7 @@ class ProfileModel: ObservableObject, Equatable {
|
||||
text_filter.limit = 500
|
||||
|
||||
print("subscribing to profile \(pubkey) with sub_id \(sub_id)")
|
||||
print_filters(relay_id: "profile", filters: [[text_filter], [profile_filter]])
|
||||
//print_filters(relay_id: "profile", filters: [[text_filter], [profile_filter]])
|
||||
damus.pool.subscribe(sub_id: sub_id, filters: [text_filter], handler: handle_event)
|
||||
damus.pool.subscribe(sub_id: prof_subid, filters: [profile_filter], handler: handle_event)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user