Files
scylladb/utils
Michał Chojnowski 5a3e4a1cc0 utils: managed_bytes: optimize memory usage for small buffers
managed_bytes is implemented as chain of blob_storage objects.
Each blob_storage contains 24 bytes of metadata. But in the most
common case -- when there is only a single element in the chain --
16 bytes of this metadata is trivial/unused.

This is regrettable waste because managed_bytes is used for every
database cell in the memtables and cache. It means that every value
of size >= 7 bytes (smaller ones fit in the inline storage of
managed_bytes) receives 16 bytes of useless overhead.

To correct that, this patch adds to managed_bytes an alternative storage
layout -- used for buffers small enough to fit in one contiguous
fragment -- which only stores the necessary minimum of metadata.
(That is: a pointer to the parent, to facilitate moving the storage during
memory defragmentation).
2024-02-09 20:56:20 +01:00
..
2023-09-11 14:38:46 +03:00
2024-01-18 12:50:06 +02:00
2023-12-02 22:37:22 +02:00
2023-12-02 22:37:22 +02:00
2024-01-18 12:50:06 +02:00
2024-01-18 12:50:06 +02:00
2022-06-02 11:21:05 +03:00
2023-12-05 15:18:11 +02:00
2024-01-18 12:50:06 +02:00
2024-02-01 14:50:17 +02:00
2023-12-02 22:37:22 +02:00
2023-12-05 15:18:11 +02:00
2023-12-05 15:18:11 +02:00
2024-01-18 12:50:06 +02:00
2023-12-05 15:18:11 +02:00
2023-09-01 22:34:23 +02:00
2023-12-02 22:37:22 +02:00
2024-01-24 10:30:52 +02:00
2024-01-18 12:50:06 +02:00
2023-01-27 19:15:39 +01:00
2023-12-02 22:37:22 +02:00
2024-02-01 10:27:55 +02:00
2024-02-01 10:27:55 +02:00