• F
    create compressed_levels_ in Version, allocate its space using arena. Make... · f697cad1
    Feng Zhu 提交于
    create compressed_levels_ in Version, allocate its space using arena. Make Version::Get, Version::FindFile faster
    
    Summary:
        Define CompressedFileMetaData that just contains fd, smallest_slice, largest_slice. Create compressed_levels_ in Version, the space is allocated using arena
        Thus increase the file meta data locality, speed up "Get" and "FindFile"
    
        benchmark with in-memory tmpfs, could have 4% improvement under "random read" and 2% improvement under "read while writing"
    
    benchmark command:
    ./db_bench --db=/mnt/db/rocksdb --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --block_size=4096 --cache_size=17179869184 --cache_numshardbits=6 --compression_type=none --compression_ratio=1 --min_level_to_compress=-1 --disable_seek_compaction=1 --hard_rate_limit=2 --write_buffer_size=134217728 --max_write_buffer_number=2 --level0_file_num_compaction_trigger=8 --target_file_size_base=33554432 --max_bytes_for_level_base=1073741824 --disable_wal=0 --sync=0 --disable_data_sync=1 --verify_checksum=1 --delete_obsolete_files_period_micros=314572800 --max_grandparent_overlap_factor=10 --max_background_compactions=4 --max_background_flushes=0 --level0_slowdown_writes_trigger=16 --level0_stop_writes_trigger=24 --statistics=0 --stats_per_interval=0 --stats_interval=1048576 --histogram=0 --use_plain_table=1 --open_files=-1 --mmap_read=1 --mmap_write=0 --memtablerep=prefix_hash --bloom_bits=10 --bloom_locality=1 --perf_level=0 --benchmarks=readwhilewriting,readwhilewriting,readwhilewriting --use_existing_db=1 --num=52428800 --threads=1 —writes_per_second=81920
    
    Read Random:
    From 1.8363 ms/op, improve to 1.7587 ms/op.
    Read while writing:
    From 2.985 ms/op, improve to 2.924 ms/op.
    
    Test Plan:
        make all check
    
    Reviewers: ljin, haobo, yhchiang, sdong
    
    Reviewed By: sdong
    
    Subscribers: dhruba, igor
    
    Differential Revision: https://reviews.facebook.net/D19419
    f697cad1
compaction.h 6.2 KB