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.
Loading
Please register or sign in to comment