Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 1/3] vinyl: remove useless local var from vy_range_update_compact_priority
Date: Sat, 20 Oct 2018 21:23:08 +0300	[thread overview]
Message-ID: <b0d7a797d4456e367db776d110089764c182f6e6.1540057300.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1540057300.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1540057300.git.vdavydov.dev@gmail.com>

Local variable total_size equals total_stmt_count.bytes_compressed so we
don't really need it.
---
 src/box/vy_range.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/box/vy_range.c b/src/box/vy_range.c
index 0558098a..af1227ea 100644
--- a/src/box/vy_range.c
+++ b/src/box/vy_range.c
@@ -312,8 +312,6 @@ vy_range_update_compact_priority(struct vy_range *range,
 	vy_disk_stmt_counter_reset(&total_stmt_count);
 	/* Total number of checked runs. */
 	uint32_t total_run_count = 0;
-	/* The total size of runs checked so far. */
-	uint64_t total_size = 0;
 	/* Estimated size of a compacted run, if compaction is scheduled. */
 	uint64_t est_new_run_size = 0;
 	/* The number of runs at the current level. */
@@ -335,7 +333,6 @@ vy_range_update_compact_priority(struct vy_range *range,
 		 */
 		if (target_run_size == 0)
 			target_run_size = size;
-		total_size += size;
 		level_run_count++;
 		total_run_count++;
 		vy_disk_stmt_counter_add(&total_stmt_count, &slice->count);
@@ -377,7 +374,7 @@ vy_range_update_compact_priority(struct vy_range *range,
 			 */
 			range->compact_priority = total_run_count;
 			range->compact_queue = total_stmt_count;
-			est_new_run_size = total_size;
+			est_new_run_size = total_stmt_count.bytes_compressed;
 		}
 	}
 }
-- 
2.11.0

  reply	other threads:[~2018-10-20 18:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20 18:23 [PATCH 0/3] Force compaction if there too many DELETEs Vladimir Davydov
2018-10-20 18:23 ` Vladimir Davydov [this message]
2018-10-23  8:51   ` [tarantool-patches] Re: [PATCH 1/3] vinyl: remove useless local var from vy_range_update_compact_priority Konstantin Osipov
2018-10-24 11:19     ` Vladimir Davydov
2018-10-20 18:23 ` [PATCH 2/3] vinyl: account disk statements of each type Vladimir Davydov
2018-10-23  8:58   ` [tarantool-patches] " Konstantin Osipov
2018-10-24 11:19     ` Vladimir Davydov
2018-10-20 18:23 ` [PATCH 3/3] vinyl: force major compaction if there are too many DELETEs Vladimir Davydov
2018-10-23  9:03   ` [tarantool-patches] " Konstantin Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0d7a797d4456e367db776d110089764c182f6e6.1540057300.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 1/3] vinyl: remove useless local var from vy_range_update_compact_priority' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox