Add trie-based user search cache to replace non-performant linear scans
Changelog-Added: Speed up user search Tested-by: William Casarin <jb55@jb55.com> Fixes: #1219 Closes: #1342
This commit is contained in:
@@ -162,7 +162,8 @@ func get_profile_url(picture: String?, pubkey: String, profiles: Profiles) -> UR
|
||||
}
|
||||
|
||||
func make_preview_profiles(_ pubkey: String) -> Profiles {
|
||||
let profiles = Profiles()
|
||||
let user_search_cache = UserSearchCache()
|
||||
let profiles = Profiles(user_search_cache: user_search_cache)
|
||||
let picture = "http://cdn.jb55.com/img/red-me.jpg"
|
||||
let profile = Profile(name: "jb55", display_name: "William Casarin", about: "It's me", picture: picture, banner: "", website: "https://jb55.com", lud06: nil, lud16: nil, nip05: "jb55.com", damus_donation: nil)
|
||||
let ts_profile = TimestampedProfile(profile: profile, timestamp: 0, event: test_event)
|
||||
|
||||
Reference in New Issue
Block a user