]> git.saurik.com Git - redis.git/blobdiff - client-libraries/clojure/benchmarks/ruby.clj
Clojure library thanks to Ragnar Dahlén
[redis.git] / client-libraries / clojure / benchmarks / ruby.clj
diff --git a/client-libraries/clojure/benchmarks/ruby.clj b/client-libraries/clojure/benchmarks/ruby.clj
new file mode 100644 (file)
index 0000000..0ede54d
--- /dev/null
@@ -0,0 +1,26 @@
+(ns benchmarks.ruby
+  (:require redis))
+
+
+(dotimes [n 2]
+  (redis/with-server 
+   {}
+   (redis/set "foo" "The first line we sent to the server is some text")
+   (time 
+    (dotimes [i 20000]
+      (let [key (str "key" i)]
+        (redis/set key "The first line we sent to the server is some text")
+        (redis/get "foo"))))))
+
+
+;(redis/with-server 
+; {}
+; (redis/set "foo" "The first line we sent to the server is some text")
+; (time 
+;  (dotimes [i 20000]
+;    (let [key (str "push_trim" i)]
+;      (redis/lpush key i)
+;      (redis/ltrim key 0 30)))))
+
+
+