Overview Tutorial API reference Examples Build Download ZmqMessage 0.1 - 21 Oct 2011

tests/PerfTest.cpp File Reference

Measuring performance of receiving/transmitting multipart ZMQ message using ZmqMessage library compared to plain ZMQ C++ API. More...

#include "pthread.h"
#include <cstddef>
#include <cassert>
#include <cstring>
#include <iostream>
#include "ZmqMessage.hpp"
#include "../examples/StringFace.hpp"

Defines

#define ZMQMESSAGE_LOG_STREAM   ZMQMESSAGE_LOG_STREAM_NONE
#define ARRAY_LEN(arr)   sizeof(arr)/sizeof((arr)[0])

Functions

zmq::context_t ctx (1)
void raw_sender (zmq::socket_t &s)
void multipart_sender (zmq::socket_t &s)
void * raw_receiver (void *arg)
void * multipart_receiver (void *arg)
int main (int, char **)

Variables

char * endpoint_raw = "inproc://simple-test-raw"
char * endpoint_mes = "inproc://simple-test-mes"
const char PART1 [] = "01234567890"
const char PART2 [] = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee"
const char PART3 [] = "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd"
const char * req_parts [] = {"part1", "part2", "part3"}
const size_t ITERS = 100000


Detailed Description

Measuring performance of receiving/transmitting multipart ZMQ message using ZmqMessage library compared to plain ZMQ C++ API.

Copyright (c) 2010-2011 Phorm, Inc. GNU LGPL v 3.0, see http://www.gnu.org/licenses/lgpl-3.0-standalone.html

Author:
Andrey Skryabin <andrew@zmqmessage.org>, et al.
Test:

We make 100000 request-response transactions between 2 threads and print results.


Define Documentation

#define ARRAY_LEN ( arr   )     sizeof(arr)/sizeof((arr)[0])

#define ZMQMESSAGE_LOG_STREAM   ZMQMESSAGE_LOG_STREAM_NONE

Variable or macro to stream log messages to (with operator <<). This enables you to adapt ZmqMessage to you logging system. By default, std::cerr is used (when NDEBUG macro is set), otherwise ZmqMessage is silent. If you want to disable logging even for debug builds, use ZMQMESSAGE_LOG_STREAM_NONE

 #define ZMQMESSAGE_LOG_STREAM ZMQMESSAGE_LOG_STREAM_NONE
Note, that this constant is overridable either for application builds without shared library or during compiling shared library. Defining this setting in your application headers during building with shared library takes no effect.


Function Documentation

zmq::context_t ctx (  ) 

int main ( int  ,
char **   
)

void* multipart_receiver ( void *  arg  ) 

void multipart_sender ( zmq::socket_t &  s  ) 

void* raw_receiver ( void *  arg  ) 

void raw_sender ( zmq::socket_t &  s  ) 


Variable Documentation

char* endpoint_mes = "inproc://simple-test-mes"

char* endpoint_raw = "inproc://simple-test-raw"

const size_t ITERS = 100000

const char PART1[] = "01234567890"

const char PART2[] = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee"

const char PART3[] = "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd"

const char* req_parts[] = {"part1", "part2", "part3"}


ZmqMessage 0.1 — open source software, support@zmqmessage.org