-
Notifications
You must be signed in to change notification settings - Fork 14
Efficient
Despite its priority is first and foremost to be scalable, AtomEventStore still strives towards being reasonably efficient where possible.
Since there's no server component, the client must perform all filtering and projection of an event stream. That involves reading the events from storage into memory, which, depending on the storage mechanism in use, may take some time. However, if the client knows that it isn't going to need to read the entire event stream, the choice of reading forwards or backwards through the event stream may impact performance. Therefore, AtomEventStore includes both a forward-reading Iterator and a backwards-reading Iterator.
Additionally, both Iterators utilize a read-ahead strategy where they pre-fetch the next Atom Feed page to read once enumeration starts in earnest. Still, in order to prevent too many unnecessary pre-fetch operations, pre-fetching first kicks in when the Iterator moves past the first element in a sequence. Thus, peeking at the head of the sequence doesn't trigger a pre-fetch.