index: allocate iterators from memory pools
Currently, index iterator allocation and initialization are separated. This is done in order to speed up iterator creation when the caller does not yield: there's 'position' method, which returns a preallocated iterator and can be used instead of costly 'alloc'; the iterator returned by this method needs to be initialized just like an iterator allocated normally, via 'alloc'. This looks ugly, because 'position' is engine-dependent, e.g. it can't be used in case of vinyl, because vinyl yields internally. Let's allocate all index iterators from memory pools. Since allocation from a memory pool is very cheap, this will allow us to get rid of the above-mentioned 'position' hack and simplify the iterator API.
Showing
- src/box/index.h 3 additions, 3 deletionssrc/box/index.h
- src/box/memtx_bitset.c 16 additions, 5 deletionssrc/box/memtx_bitset.c
- src/box/memtx_engine.c 10 additions, 0 deletionssrc/box/memtx_engine.c
- src/box/memtx_engine.h 9 additions, 0 deletionssrc/box/memtx_engine.h
- src/box/memtx_hash.c 16 additions, 4 deletionssrc/box/memtx_hash.c
- src/box/memtx_rtree.c 13 additions, 5 deletionssrc/box/memtx_rtree.c
- src/box/memtx_tree.c 15 additions, 4 deletionssrc/box/memtx_tree.c
- src/box/sysview_engine.c 3 additions, 0 deletionssrc/box/sysview_engine.c
- src/box/sysview_engine.h 4 additions, 0 deletionssrc/box/sysview_engine.h
- src/box/sysview_index.c 17 additions, 5 deletionssrc/box/sysview_index.c
- src/box/vinyl_engine.c 3 additions, 1 deletionsrc/box/vinyl_engine.c
- src/box/vinyl_engine.h 3 additions, 0 deletionssrc/box/vinyl_engine.h
- src/box/vinyl_index.c 16 additions, 5 deletionssrc/box/vinyl_index.c
Loading
Please register or sign in to comment