Permalink
Browse files

implement the LOCAL-LAT benchmark

  • Loading branch information...
1 parent ab1f0b9 commit 8c7fa64f9eb444ad2852ec8fdad1115893ecaf62 @galdor galdor committed Oct 3, 2011
Showing with 15 additions and 1 deletion.
  1. +13 −0 examples/official-benchmarks.lisp
  2. +2 −1 examples/packages.lisp
View
13 examples/official-benchmarks.lisp
@@ -31,3 +31,16 @@
((= i message-count))
(zmq:with-msg-init-size (message message-size)
(zmq:send socket message))))))
+
+(defun local-lat (address message-size roundtrip-count)
+ (zmq:with-context (context 1)
+ (zmq:with-socket (socket context :rep)
+ (zmq:bind socket address)
+ (zmq:with-msg-init (message)
+ (do ((i 0 (1+ i)))
+ ((= i roundtrip-count))
+ (zmq:recv socket message)
+ (unless (eq (zmq:msg-size message) message-size)
+ (error "Message of incorrect size ~A received."
+ (zmq:msg-size message)))
+ (zmq:send socket message))))))
View
3 examples/packages.lisp
@@ -2,4 +2,5 @@
(defpackage :zeromq-examples
(:nicknames :zmq-examples)
(:use :cl)
- (:export :local-thr))
+ (:export :local-thr :remote-thr
+ :local-lat))

0 comments on commit 8c7fa64

Please sign in to comment.