Commit aadbe77c authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:3924], don't bother compressing buffers that are really small

git-svn-id: file:///svn/toku/tokudb@35645 c7de825b-a66e-492c-adef-691d508d4ae1
parent e26dfb9a
...@@ -776,7 +776,9 @@ void toku_brtnode_pe_est_callback( ...@@ -776,7 +776,9 @@ void toku_brtnode_pe_est_callback(
// we estimate the compressed size of data to be how large // we estimate the compressed size of data to be how large
// the compressed data is on disk // the compressed data is on disk
for (int i = 0; i < node->n_children; i++) { for (int i = 0; i < node->n_children; i++) {
if (BP_STATE(node,i) == PT_AVAIL && BP_SHOULD_EVICT(node,i)) { if (BP_STATE(node,i) == PT_AVAIL &&
BP_SHOULD_EVICT(node,i) &&
toku_bnc_nbytesinbuf(BNC(node, i)) > 0) {
// calculate how much data would be freed if // calculate how much data would be freed if
// we compress this node and add it to // we compress this node and add it to
// bytes_to_free // bytes_to_free
...@@ -836,8 +838,10 @@ int toku_brtnode_pe_callback (void *brtnode_pv, long UU(bytes_to_free), long* by ...@@ -836,8 +838,10 @@ int toku_brtnode_pe_callback (void *brtnode_pv, long UU(bytes_to_free), long* by
for (int i = 0; i < node->n_children; i++) { for (int i = 0; i < node->n_children; i++) {
if (BP_STATE(node,i) == PT_AVAIL) { if (BP_STATE(node,i) == PT_AVAIL) {
if (BP_SHOULD_EVICT(node,i)) { if (BP_SHOULD_EVICT(node,i)) {
if (toku_bnc_nbytesinbuf(BNC(node, i)) > 0) {
cilk_spawn compress_internal_node_partition(node, i); cilk_spawn compress_internal_node_partition(node, i);
} }
}
else { else {
BP_SWEEP_CLOCK(node,i); BP_SWEEP_CLOCK(node,i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment