box: implement compact mode in tuples
Tuple are designed to store (almost) any sizes of msgpack data and rather big count of field offsets. That requires data_offsert and bsize members of tuples to be rather large - 16 and 32 bits. That is good, but the problem is that in cases when the majority of tuples are small that price is significant. This patch introduces compact tuples: if tuple data size and its offset table are small - both tuple_offset and bsize are stored in one 16 bit integer and that saves 4 bytes per tuple. Compact tuples are used for memtx and runtime tuples. They are not implemented for vinyl, because in contrast to memtx vinyl stores engine specific fields after struct tuple and thus requires different approach for compact tuple. Part of #5385
Showing
- changelogs/unreleased/gh-5385-tiny-tuples-v3.md 3 additions, 0 deletionschangelogs/unreleased/gh-5385-tiny-tuples-v3.md
- src/box/memtx_engine.c 7 additions, 1 deletionsrc/box/memtx_engine.c
- src/box/tuple.c 7 additions, 2 deletionssrc/box/tuple.c
- src/box/tuple.h 82 additions, 14 deletionssrc/box/tuple.h
- src/box/vy_stmt.c 1 addition, 1 deletionsrc/box/vy_stmt.c
- test/box/errinj.result 9 additions, 9 deletionstest/box/errinj.result
- test/box/upsert_errinj.result 1 addition, 1 deletiontest/box/upsert_errinj.result
Loading
Please register or sign in to comment