Skip to content

Instantly share code, notes, and snippets.

@yoav-steinberg
yoav-steinberg / test.diff
Created February 13, 2022 16:04
Improve zslRandomLevel
diff --git a/src/server.c b/src/server.c
index 16cf285e1..9b4fb30b0 100644
--- a/src/server.c
+++ b/src/server.c
@@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+
#include "server.h"
import redis
r = redis.Redis()
base = 0 # Smallest allowed key in samples
jump = 50 # Key size bins
top = 1300 # Largest allowed key in sample
samples = 1000 # Numbers of samples
bins = []
for i in xrange(1+(top-base)/jump):
@yoav-steinberg
yoav-steinberg / rediff.py
Created April 13, 2014 15:48
rediff - the redis diff script
import urlparse
import argparse
import redis
import sys
from multiprocessing import Pool
import signal
def parse_redis_url(s):
url = urlparse.urlparse(s)
if not url.scheme: