Skip to content
Snippets Groups Projects
Commit f632642a authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

vinyl: eliminate current stmt reallocations in run iterator

Run iterator uses curr_pos (i.e. page number plus offset) as pointer to
the current position. Whenever it needs to get a statement at curr_pos,
it calls vy_run_iterator_read(), which allocates a new statement. It
doesn't try to cache the last allocated statement, which results in
multiple pointless reallocations of the same statement. For instance,
vy_run_iterator_next_key() rereads the current statement, then moves to
the next key, then calls vy_run_iterator_find_lsn(), which rereads the
current statement again. This is just stupid.

To avoid that, let's keep vy_run_iterator->curr_stmt in sync with
curr_pos. This simplifies the code quite a bit and makes it more
efficient.
parent 392e4b25
No related branches found
No related tags found
Loading
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