Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-16181: Compress system events for ephemeral buckets
For ephemeral vbuckets, compress the system-event Item as it will be retained in memory. This can reduce the memory overhead that results from the creation of scopes and collections, especially when long names are used. The actual improvement really depends on the length and content of the name, i.e. can snappy actually achieve good compression and note that the 'compressValue' result in no change to the Item if it could not compress the value. For reference we have 4 types of System-Event (4 different value formats) and they are all 'flatbuffer' types. The flatbuffer types that define the create system-events store the name and are of interest to this change. The following table shows the size of the CreateCollection value as name increases (max name length is 251). name length | size =================== 0 | 40 2 | 40 4 | 44 6 | 44 8 | 48 10 | 48 12 | 52 14 | 52 16 | 56 18 | 56 251 | 288 From that table the CreateCollection value size is: 40 + 4 * (strlen(name) / 4) The fixed 40 bytes doesn't compress, so the result is all in the name. Note: CreateScope is very similar to CreateCollection, it is slightly smaller but stores a name which can be upto 251 bytes. DropCollection/DropScope do not store a name and are currently 24 bytes and those 24 bytes do not compress. Change-Id: Id293e6eda133e82be4251454f1db02a40ff2a2c6 Reviewed-on: http://review.couchbase.org/c/kv_engine/+/143918 Reviewed-by: Dave Rigby <daver@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
- Loading branch information