rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Performance Regression Observed in DeleteRange and CompactRange Operations Post-Commit ca7367a

Open Gallopm opened this issue 8 months ago • 2 comments

Expected Behavior:
The execution time of DeleteRange followed by CompactRange operations should remain consistent or improve across commits, maintaining optimal performance for key-range deletions and compactions.

Actual Behavior:
After commit ca7367a, a noticeable performance regression has been observed. The average execution time for the following sequence of operations increased ~2%:

  1. Deleting a range of keys using DeleteRange.
  2. Compacting a larger key range using CompactRange.

Steps to Reproduce the Behavior:

  1. Fill 300000 key-value pairs into the Rocksdb database, while the key format is key$i, and value is a string of length from 10 to 99.
  2. Check out the commit immediately prior to ca7367a and run the following test code:
    rocksdb::Slice start_key("key300"), end_key("key500");  
    db->DeleteRange(rocksdb::WriteOptions(), db->DefaultColumnFamily(), start_key, end_key);  
    rocksdb::Slice start_key1("key200"); 
    rocksdb::Slice end_key2("key700");  
    rocksdb::CompactRangeOptions comp_options;  
    db->CompactRange(comp_options, &start_key1, &end_key2);  
    
    Measure the average execution time.
  3. Check out commit ca7367a or later and run the same test code, measuring the average execution time again.
  4. Compare the results. The post-ca7367a execution time should show a consistent increase in latency.

Gallopm avatar Apr 16 '25 09:04 Gallopm

cc @jaykorean thoughts on this?

zaidoon1 avatar Apr 18 '25 08:04 zaidoon1

cc @cbi42

jaykorean avatar Apr 25 '25 20:04 jaykorean