summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
Diffstat (limited to 'perf')
-rw-r--r--perf/Makefile.am22
-rw-r--r--perf/Makefile.in571
-rw-r--r--perf/inproc_lat.cpp231
-rw-r--r--perf/inproc_thr.cpp241
-rw-r--r--perf/local_lat.cpp107
-rw-r--r--perf/local_thr.cpp131
-rw-r--r--perf/remote_lat.cpp120
-rw-r--r--perf/remote_thr.cpp98
8 files changed, 1521 insertions, 0 deletions
diff --git a/perf/Makefile.am b/perf/Makefile.am
new file mode 100644
index 0000000..4053ba5
--- /dev/null
+++ b/perf/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = -I$(top_builddir)/include \
+ -I$(top_srcdir)/include
+
+noinst_PROGRAMS = local_lat remote_lat local_thr remote_thr inproc_lat inproc_thr
+
+local_lat_LDADD = $(top_builddir)/src/libzmq.la
+local_lat_SOURCES = local_lat.cpp
+
+remote_lat_LDADD = $(top_builddir)/src/libzmq.la
+remote_lat_SOURCES = remote_lat.cpp
+
+local_thr_LDADD = $(top_builddir)/src/libzmq.la
+local_thr_SOURCES = local_thr.cpp
+
+remote_thr_LDADD = $(top_builddir)/src/libzmq.la
+remote_thr_SOURCES = remote_thr.cpp
+
+inproc_lat_LDADD = $(top_builddir)/src/libzmq.la
+inproc_lat_SOURCES = inproc_lat.cpp
+
+inproc_thr_LDADD = $(top_builddir)/src/libzmq.la
+inproc_thr_SOURCES = inproc_thr.cpp
diff --git a/perf/Makefile.in b/perf/Makefile.in
new file mode 100644
index 0000000..f52a4f9
--- /dev/null
+++ b/perf/Makefile.in
@@ -0,0 +1,571 @@
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = local_lat$(EXEEXT) remote_lat$(EXEEXT) \
+ local_thr$(EXEEXT) remote_thr$(EXEEXT) inproc_lat$(EXEEXT) \
+ inproc_thr$(EXEEXT)
+subdir = perf
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+ $(top_srcdir)/config/ltoptions.m4 \
+ $(top_srcdir)/config/ltsugar.m4 \
+ $(top_srcdir)/config/ltversion.m4 \
+ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/platform.hpp
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_inproc_lat_OBJECTS = inproc_lat.$(OBJEXT)
+inproc_lat_OBJECTS = $(am_inproc_lat_OBJECTS)
+inproc_lat_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am_inproc_thr_OBJECTS = inproc_thr.$(OBJEXT)
+inproc_thr_OBJECTS = $(am_inproc_thr_OBJECTS)
+inproc_thr_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_local_lat_OBJECTS = local_lat.$(OBJEXT)
+local_lat_OBJECTS = $(am_local_lat_OBJECTS)
+local_lat_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_local_thr_OBJECTS = local_thr.$(OBJEXT)
+local_thr_OBJECTS = $(am_local_thr_OBJECTS)
+local_thr_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_remote_lat_OBJECTS = remote_lat.$(OBJEXT)
+remote_lat_OBJECTS = $(am_remote_lat_OBJECTS)
+remote_lat_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+am_remote_thr_OBJECTS = remote_thr.$(OBJEXT)
+remote_thr_OBJECTS = $(am_remote_thr_OBJECTS)
+remote_thr_DEPENDENCIES = $(top_builddir)/src/libzmq.la
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(inproc_lat_SOURCES) $(inproc_thr_SOURCES) \
+ $(local_lat_SOURCES) $(local_thr_SOURCES) \
+ $(remote_lat_SOURCES) $(remote_thr_SOURCES)
+DIST_SOURCES = $(inproc_lat_SOURCES) $(inproc_thr_SOURCES) \
+ $(local_lat_SOURCES) $(local_thr_SOURCES) \
+ $(remote_lat_SOURCES) $(remote_thr_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+ASCIIDOC = @ASCIIDOC@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@
+LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
+LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTVER = @LTVER@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+OpenPGM_CFLAGS = @OpenPGM_CFLAGS@
+OpenPGM_LIBS = @OpenPGM_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMLTO = @XMLTO@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libzmq_have_asciidoc = @libzmq_have_asciidoc@
+libzmq_have_xmlto = @libzmq_have_xmlto@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pgm_basename = @pgm_basename@
+pgm_srcdir = @pgm_srcdir@
+pgm_subdir = @pgm_subdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = -I$(top_builddir)/include \
+ -I$(top_srcdir)/include
+
+local_lat_LDADD = $(top_builddir)/src/libzmq.la
+local_lat_SOURCES = local_lat.cpp
+remote_lat_LDADD = $(top_builddir)/src/libzmq.la
+remote_lat_SOURCES = remote_lat.cpp
+local_thr_LDADD = $(top_builddir)/src/libzmq.la
+local_thr_SOURCES = local_thr.cpp
+remote_thr_LDADD = $(top_builddir)/src/libzmq.la
+remote_thr_SOURCES = remote_thr.cpp
+inproc_lat_LDADD = $(top_builddir)/src/libzmq.la
+inproc_lat_SOURCES = inproc_lat.cpp
+inproc_thr_LDADD = $(top_builddir)/src/libzmq.la
+inproc_thr_SOURCES = inproc_thr.cpp
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign perf/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign perf/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+inproc_lat$(EXEEXT): $(inproc_lat_OBJECTS) $(inproc_lat_DEPENDENCIES) $(EXTRA_inproc_lat_DEPENDENCIES)
+ @rm -f inproc_lat$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(inproc_lat_OBJECTS) $(inproc_lat_LDADD) $(LIBS)
+inproc_thr$(EXEEXT): $(inproc_thr_OBJECTS) $(inproc_thr_DEPENDENCIES) $(EXTRA_inproc_thr_DEPENDENCIES)
+ @rm -f inproc_thr$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(inproc_thr_OBJECTS) $(inproc_thr_LDADD) $(LIBS)
+local_lat$(EXEEXT): $(local_lat_OBJECTS) $(local_lat_DEPENDENCIES) $(EXTRA_local_lat_DEPENDENCIES)
+ @rm -f local_lat$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(local_lat_OBJECTS) $(local_lat_LDADD) $(LIBS)
+local_thr$(EXEEXT): $(local_thr_OBJECTS) $(local_thr_DEPENDENCIES) $(EXTRA_local_thr_DEPENDENCIES)
+ @rm -f local_thr$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(local_thr_OBJECTS) $(local_thr_LDADD) $(LIBS)
+remote_lat$(EXEEXT): $(remote_lat_OBJECTS) $(remote_lat_DEPENDENCIES) $(EXTRA_remote_lat_DEPENDENCIES)
+ @rm -f remote_lat$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(remote_lat_OBJECTS) $(remote_lat_LDADD) $(LIBS)
+remote_thr$(EXEEXT): $(remote_thr_OBJECTS) $(remote_thr_DEPENDENCIES) $(EXTRA_remote_thr_DEPENDENCIES)
+ @rm -f remote_thr$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(remote_thr_OBJECTS) $(remote_thr_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inproc_lat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inproc_thr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_lat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_thr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote_lat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote_thr.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/perf/inproc_lat.cpp b/perf/inproc_lat.cpp
new file mode 100644
index 0000000..e5d080a
--- /dev/null
+++ b/perf/inproc_lat.cpp
@@ -0,0 +1,231 @@
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "platform.hpp"
+
+#if defined ZMQ_HAVE_WINDOWS
+#include <windows.h>
+#include <process.h>
+#else
+#include <pthread.h>
+#endif
+
+static size_t message_size;
+static int roundtrip_count;
+
+#if defined ZMQ_HAVE_WINDOWS
+static unsigned int __stdcall worker (void *ctx_)
+#else
+static void *worker (void *ctx_)
+#endif
+{
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+
+ s = zmq_socket (ctx_, ZMQ_REP);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ rc = zmq_connect (s, "inproc://lat_test");
+ if (rc != 0) {
+ printf ("error in zmq_connect: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ rc = zmq_msg_init (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ for (i = 0; i != roundtrip_count; i++) {
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+ }
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+#if defined ZMQ_HAVE_WINDOWS
+ return 0;
+#else
+ return NULL;
+#endif
+}
+
+int main (int argc, char *argv [])
+{
+#if defined ZMQ_HAVE_WINDOWS
+ HANDLE local_thread;
+#else
+ pthread_t local_thread;
+#endif
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+ void *watch;
+ unsigned long elapsed;
+ double latency;
+
+ if (argc != 3) {
+ printf ("usage: inproc_lat <message-size> <roundtrip-count>\n");
+ return 1;
+ }
+
+ message_size = atoi (argv [1]);
+ roundtrip_count = atoi (argv [2]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_REQ);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_bind (s, "inproc://lat_test");
+ if (rc != 0) {
+ printf ("error in zmq_bind: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+#if defined ZMQ_HAVE_WINDOWS
+ local_thread = (HANDLE) _beginthreadex (NULL, 0,
+ worker, ctx, 0 , NULL);
+ if (local_thread == 0) {
+ printf ("error in _beginthreadex\n");
+ return -1;
+ }
+#else
+ rc = pthread_create (&local_thread, NULL, worker, ctx);
+ if (rc != 0) {
+ printf ("error in pthread_create: %s\n", zmq_strerror (rc));
+ return -1;
+ }
+#endif
+
+ rc = zmq_msg_init_size (&msg, message_size);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ memset (zmq_msg_data (&msg), 0, message_size);
+
+ printf ("message size: %d [B]\n", (int) message_size);
+ printf ("roundtrip count: %d\n", (int) roundtrip_count);
+
+ watch = zmq_stopwatch_start ();
+
+ for (i = 0; i != roundtrip_count; i++) {
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+ }
+
+ elapsed = zmq_stopwatch_stop (watch);
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ latency = (double) elapsed / (roundtrip_count * 2);
+
+#if defined ZMQ_HAVE_WINDOWS
+ DWORD rc2 = WaitForSingleObject (local_thread, INFINITE);
+ if (rc2 == WAIT_FAILED) {
+ printf ("error in WaitForSingleObject\n");
+ return -1;
+ }
+ BOOL rc3 = CloseHandle (local_thread);
+ if (rc3 == 0) {
+ printf ("error in CloseHandle\n");
+ return -1;
+ }
+#else
+ rc = pthread_join (local_thread, NULL);
+ if (rc != 0) {
+ printf ("error in pthread_join: %s\n", zmq_strerror (rc));
+ return -1;
+ }
+#endif
+
+ printf ("average latency: %.3f [us]\n", (double) latency);
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}
+
diff --git a/perf/inproc_thr.cpp b/perf/inproc_thr.cpp
new file mode 100644
index 0000000..22116fc
--- /dev/null
+++ b/perf/inproc_thr.cpp
@@ -0,0 +1,241 @@
+/*
+ Copyright (c) 2007-2012 iMatix Corporation
+ Copyright (c) 2009-2011 250bpm s.r.o.
+ Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "platform.hpp"
+
+#if defined ZMQ_HAVE_WINDOWS
+#include <windows.h>
+#include <process.h>
+#else
+#include <pthread.h>
+#endif
+
+static int message_count;
+static size_t message_size;
+
+#if defined ZMQ_HAVE_WINDOWS
+static unsigned int __stdcall worker (void *ctx_)
+#else
+static void *worker (void *ctx_)
+#endif
+{
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+
+ s = zmq_socket (ctx_, ZMQ_PUSH);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ rc = zmq_connect (s, "inproc://thr_test");
+ if (rc != 0) {
+ printf ("error in zmq_connect: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+ for (i = 0; i != message_count; i++) {
+
+ rc = zmq_msg_init_size (&msg, message_size);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+#if defined ZMQ_MAKE_VALGRIND_HAPPY
+ memset (zmq_msg_data (&msg), 0, message_size);
+#endif
+
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+ }
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ exit (1);
+ }
+
+#if defined ZMQ_HAVE_WINDOWS
+ return 0;
+#else
+ return NULL;
+#endif
+}
+
+int main (int argc, char *argv [])
+{
+#if defined ZMQ_HAVE_WINDOWS
+ HANDLE local_thread;
+#else
+ pthread_t local_thread;
+#endif
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+ void *watch;
+ unsigned long elapsed;
+ unsigned long throughput;
+ double megabits;
+
+ if (argc != 3) {
+ printf ("usage: thread_thr <message-size> <message-count>\n");
+ return 1;
+ }
+
+ message_size = atoi (argv [1]);
+ message_count = atoi (argv [2]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_PULL);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_bind (s, "inproc://thr_test");
+ if (rc != 0) {
+ printf ("error in zmq_bind: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+#if defined ZMQ_HAVE_WINDOWS
+ local_thread = (HANDLE) _beginthreadex (NULL, 0,
+ worker, ctx, 0 , NULL);
+ if (local_thread == 0) {
+ printf ("error in _beginthreadex\n");
+ return -1;
+ }
+#else
+ rc = pthread_create (&local_thread, NULL, worker, ctx);
+ if (rc != 0) {
+ printf ("error in pthread_create: %s\n", zmq_strerror (rc));
+ return -1;
+ }
+#endif
+
+ rc = zmq_msg_init (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ printf ("message size: %d [B]\n", (int) message_size);
+ printf ("message count: %d\n", (int) message_count);
+
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+
+ watch = zmq_stopwatch_start ();
+
+ for (i = 0; i != message_count - 1; i++) {
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+ }
+
+ elapsed = zmq_stopwatch_stop (watch);
+ if (elapsed == 0)
+ elapsed = 1;
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+#if defined ZMQ_HAVE_WINDOWS
+ DWORD rc2 = WaitForSingleObject (local_thread, INFINITE);
+ if (rc2 == WAIT_FAILED) {
+ printf ("error in WaitForSingleObject\n");
+ return -1;
+ }
+ BOOL rc3 = CloseHandle (local_thread);
+ if (rc3 == 0) {
+ printf ("error in CloseHandle\n");
+ return -1;
+ }
+#else
+ rc = pthread_join (local_thread, NULL);
+ if (rc != 0) {
+ printf ("error in pthread_join: %s\n", zmq_strerror (rc));
+ return -1;
+ }
+#endif
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ throughput = (unsigned long)
+ ((double) message_count / (double) elapsed * 1000000);
+ megabits = (double) (throughput * message_size * 8) / 1000000;
+
+ printf ("mean throughput: %d [msg/s]\n", (int) throughput);
+ printf ("mean throughput: %.3f [Mb/s]\n", (double) megabits);
+
+ return 0;
+}
+
diff --git a/perf/local_lat.cpp b/perf/local_lat.cpp
new file mode 100644
index 0000000..2f1a726
--- /dev/null
+++ b/perf/local_lat.cpp
@@ -0,0 +1,107 @@
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main (int argc, char *argv [])
+{
+ const char *bind_to;
+ int roundtrip_count;
+ size_t message_size;
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+
+ if (argc != 4) {
+ printf ("usage: local_lat <bind-to> <message-size> "
+ "<roundtrip-count>\n");
+ return 1;
+ }
+ bind_to = argv [1];
+ message_size = atoi (argv [2]);
+ roundtrip_count = atoi (argv [3]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_REP);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_bind (s, bind_to);
+ if (rc != 0) {
+ printf ("error in zmq_bind: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_msg_init (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ for (i = 0; i != roundtrip_count; i++) {
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ }
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ zmq_sleep (1);
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/perf/local_thr.cpp b/perf/local_thr.cpp
new file mode 100644
index 0000000..ab7a15e
--- /dev/null
+++ b/perf/local_thr.cpp
@@ -0,0 +1,131 @@
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main (int argc, char *argv [])
+{
+ const char *bind_to;
+ int message_count;
+ size_t message_size;
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+ void *watch;
+ unsigned long elapsed;
+ unsigned long throughput;
+ double megabits;
+
+ if (argc != 4) {
+ printf ("usage: local_thr <bind-to> <message-size> <message-count>\n");
+ return 1;
+ }
+ bind_to = argv [1];
+ message_size = atoi (argv [2]);
+ message_count = atoi (argv [3]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_PULL);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ // Add your socket options here.
+ // For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
+
+ rc = zmq_bind (s, bind_to);
+ if (rc != 0) {
+ printf ("error in zmq_bind: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_msg_init (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+
+ watch = zmq_stopwatch_start ();
+
+ for (i = 0; i != message_count - 1; i++) {
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+ }
+
+ elapsed = zmq_stopwatch_stop (watch);
+ if (elapsed == 0)
+ elapsed = 1;
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ throughput = (unsigned long)
+ ((double) message_count / (double) elapsed * 1000000);
+ megabits = (double) (throughput * message_size * 8) / 1000000;
+
+ printf ("message size: %d [B]\n", (int) message_size);
+ printf ("message count: %d\n", (int) message_count);
+ printf ("mean throughput: %d [msg/s]\n", (int) throughput);
+ printf ("mean throughput: %.3f [Mb/s]\n", (double) megabits);
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/perf/remote_lat.cpp b/perf/remote_lat.cpp
new file mode 100644
index 0000000..a065910
--- /dev/null
+++ b/perf/remote_lat.cpp
@@ -0,0 +1,120 @@
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main (int argc, char *argv [])
+{
+ const char *connect_to;
+ int roundtrip_count;
+ size_t message_size;
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+ void *watch;
+ unsigned long elapsed;
+ double latency;
+
+ if (argc != 4) {
+ printf ("usage: remote_lat <connect-to> <message-size> "
+ "<roundtrip-count>\n");
+ return 1;
+ }
+ connect_to = argv [1];
+ message_size = atoi (argv [2]);
+ roundtrip_count = atoi (argv [3]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_REQ);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_connect (s, connect_to);
+ if (rc != 0) {
+ printf ("error in zmq_connect: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_msg_init_size (&msg, message_size);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ memset (zmq_msg_data (&msg), 0, message_size);
+
+ watch = zmq_stopwatch_start ();
+
+ for (i = 0; i != roundtrip_count; i++) {
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ rc = zmq_recvmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ if (zmq_msg_size (&msg) != message_size) {
+ printf ("message of incorrect size received\n");
+ return -1;
+ }
+ }
+
+ elapsed = zmq_stopwatch_stop (watch);
+
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ latency = (double) elapsed / (roundtrip_count * 2);
+
+ printf ("message size: %d [B]\n", (int) message_size);
+ printf ("roundtrip count: %d\n", (int) roundtrip_count);
+ printf ("average latency: %.3f [us]\n", (double) latency);
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/perf/remote_thr.cpp b/perf/remote_thr.cpp
new file mode 100644
index 0000000..a4a7b6a
--- /dev/null
+++ b/perf/remote_thr.cpp
@@ -0,0 +1,98 @@
+/*
+ Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "../include/zmq.h"
+#include "../include/zmq_utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main (int argc, char *argv [])
+{
+ const char *connect_to;
+ int message_count;
+ int message_size;
+ void *ctx;
+ void *s;
+ int rc;
+ int i;
+ zmq_msg_t msg;
+
+ if (argc != 4) {
+ printf ("usage: remote_thr <connect-to> <message-size> "
+ "<message-count>\n");
+ return 1;
+ }
+ connect_to = argv [1];
+ message_size = atoi (argv [2]);
+ message_count = atoi (argv [3]);
+
+ ctx = zmq_init (1);
+ if (!ctx) {
+ printf ("error in zmq_init: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ s = zmq_socket (ctx, ZMQ_PUSH);
+ if (!s) {
+ printf ("error in zmq_socket: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ // Add your socket options here.
+ // For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
+
+ rc = zmq_connect (s, connect_to);
+ if (rc != 0) {
+ printf ("error in zmq_connect: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ for (i = 0; i != message_count; i++) {
+ rc = zmq_msg_init_size (&msg, message_size);
+ if (rc != 0) {
+ printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ rc = zmq_sendmsg (s, &msg, 0);
+ if (rc < 0) {
+ printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ rc = zmq_msg_close (&msg);
+ if (rc != 0) {
+ printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+ }
+
+ rc = zmq_close (s);
+ if (rc != 0) {
+ printf ("error in zmq_close: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ rc = zmq_term (ctx);
+ if (rc != 0) {
+ printf ("error in zmq_term: %s\n", zmq_strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}