Skip to content
Snippets Groups Projects
Commit 44a62002 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

vinyl: simplify memory iterator restore

To avoid lookup in the memory tree, the memory iterator ->restore()
callback tries to walk from the current iterator position to the first
statement matching the restoration criteria. Such an optimization
complicates the restoration procedure beyond comprehension and makes it
extremely error prone. Ironically, all this complexity seems to be
pointless, because a change in the memory tree means either a disk
access, which is by orders of magnitudes more expensive than a memory
lookup, or an insertion of a new statement into the tree, which has
exactly the same complexity as a lookup. That said, let's rewrite the
restoration procedure so that it always does a full lookup in case the
version of the memory tree has changed.

Also, remove handling of iterator restart and the corresponding test
case as a ->restore() callback does not need to handle them any more.
parent 0feb32b8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment