From c8c72447f6c9e999a17d37338e9d3460f45722f4 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 1 Mar 2010 22:15:49 +0100 Subject: [PATCH] =?UTF-8?q?Swappability=20bug=20due=20to=20a=20typo=20fixe?= =?UTF-8?q?d=20thanks=20to=20code=20review=20by=20Felix=20Geisend=C3=B6rfe?= =?UTF-8?q?r=20@felixge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- redis.c | 2 +- test-redis.tcl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/redis.c b/redis.c index b7fd3b5b..52ada380 100644 --- a/redis.c +++ b/redis.c @@ -7560,7 +7560,7 @@ static double computeObjectSwappability(robj *o) { } break; } - return (double)asize*log(1+asize); + return (double)age*log(1+asize); } /* Try to swap an object that's a good candidate for swapping. diff --git a/test-redis.tcl b/test-redis.tcl index 9b546722..36b82e38 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -952,7 +952,6 @@ proc main {server port} { $r sort tosort {DESC} } [lsort -decreasing -integer $res] -while 1 { test {SORT speed, sorting 10000 elements list using BY, 100 times} { set start [clock clicks -milliseconds] for {set i 0} {$i < 100} {incr i} { @@ -963,7 +962,7 @@ while 1 { flush stdout format {} } {} -} + test {SORT speed, sorting 10000 elements list directly, 100 times} { set start [clock clicks -milliseconds] for {set i 0} {$i < 100} {incr i} {