Skip to content

Conversation

fyrsta7
Copy link

@fyrsta7 fyrsta7 commented Sep 11, 2025

Summary

This PR optimizes the performance of the function DBImpl::Write in db/db_impl/db_impl_write.cc.
Performance was measured using the project's standard benchmark tools. Out of 2 test cases, the optimization achieves a maximum improvement of 5.04% while guaranteeing no regression exceeds 0.23% in any other case.

Test Plan

  1. Correctness: All existing unit tests pass.
  2. Performance: Evaluation was done using the following benchmark command: ./db_bench --benchmarks=fillseq,readrandom --db=/tmp/rocksdb_test --num=1000000

Performance Evaluation & Results

Testing Protocol:

  • The benchmark was run on an isolated Ubuntu 24.04 server.
  • The first run was discarded to account for cold-start effects.
  • The results below are the average of 5 subsequent runs.
  • The improvement for a test case is calculated as (new_value - old_value) / old_value * 100% if a higher value is better (e.g., throughput), or (old_value - new_value) / new_value * 100% if a lower value is better (e.g., latency). A positive percentage indicates a performance gain.

Results:

Test Case Improvement
readrandom_mb_change -0.23%
fillseq_mb_change 5.04%

@meta-cla meta-cla bot added the CLA Signed label Sep 11, 2025
@fyrsta7
Copy link
Author

fyrsta7 commented Sep 12, 2025

Hi @pdillinger , could you please take a look at this PR when you have a moment? Thanks!

@fyrsta7 fyrsta7 changed the title Perf: Optimize DBImpl::Write in db/db_impl/db_impl_write.cc Perf: Optimize funtion DBImpl::Write in db/db_impl/db_impl_write.cc Sep 13, 2025
@fyrsta7
Copy link
Author

fyrsta7 commented Sep 21, 2025

Could a maintainer please approve the workflow to run? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant