Show thread history
npub1acg6t
2w ago
Mmap isn't available everywhere. And it isn't efficient everywhere. It is certainly good on linux though. Passing references requires care that they are read only, but rust is good with that kind of thing. So in a rust-on-linux environment, option 3 works out pretty good. Pocket screams.
The iterator thing is a bit complicated, just because searching a database of nostr events by filter requires first determining which indices are going to give you the fastest result, and then keeping your place with internal iterators over that index. For example I have an author-kind index which stores as unique keys (author, kind, created_at, id). I have to keep an iterator over all authors specified in the filter, another over all kinds specified, and a third over this index. When the third runs out, I bump the kind. When that runs out, I bump the author. The result is NOT sorted by time though. To keep the data sorted by time requires keeping too many iterators (if you have 100 authors and 10 kind, that is 1000 iterators and you have to find the one yielding the newest event... not worth it).
The iterator thing is a bit complicated, just because searching a database of nostr events by filter requires first determining which indices are going to give you the fastest result, and then keeping your place with internal iterators over that index. For example I have an author-kind index which stores as unique keys (author, kind, created_at, id). I have to keep an iterator over all authors specified in the filter, another over all kinds specified, and a third over this index. When the third runs out, I bump the kind. When that runs out, I bump the author. The result is NOT sorted by time though. To keep the data sorted by time requires keeping too many iterators (if you have 100 authors and 10 kind, that is 1000 iterators and you have to find the one yielding the newest event... not worth it).
See translation
0
0
0
0
0
No replies