summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS0
-rw-r--r--ChangeLog0
-rw-r--r--Makefile.am7
-rw-r--r--NEWS0
-rwxr-xr-xbootstrap119
-rw-r--r--c/AUTHORS0
-rw-r--r--c/ChangeLog0
-rw-r--r--c/Makefile17
-rw-r--r--c/Makefile.am15
-rw-r--r--c/NEWS0
-rw-r--r--c/README0
-rwxr-xr-xc/bootstrap3
-rw-r--r--c/configure.in11
-rw-r--r--configure.in10
-rw-r--r--cpp/AUTHORS0
-rw-r--r--cpp/ChangeLog0
-rw-r--r--cpp/Makefile25
-rw-r--r--cpp/Makefile.am20
-rw-r--r--cpp/NEWS0
-rw-r--r--cpp/README0
-rwxr-xr-xcpp/bootstrap3
-rw-r--r--cpp/configure.in14
-rw-r--r--ruby/bench.rb22
23 files changed, 218 insertions, 48 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/AUTHORS
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..9d1282d
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,7 @@
+SUBDIRS = c cpp
+
+nobase_include_HEADERS = \
+ msgpack/pack/inline_impl.h \
+ msgpack/unpack/inline_context.h \
+ msgpack/unpack/inline_impl.h
+
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/bootstrap b/bootstrap
new file mode 100755
index 0000000..954fa89
--- /dev/null
+++ b/bootstrap
@@ -0,0 +1,119 @@
+#!/bin/sh
+# vim:ts=4:sw=4
+# Calls autotools to build configure script and Makefile.in.
+# Generated automatically using bootstrapper 0.2.1
+# http://bootstrapper.sourceforge.net/
+#
+# Copyright (C) 2002 Anthony Ventimiglia
+#
+# This bootstrap script is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+#
+# Calls proper programs to create configure script and Makefile.in files.
+# if run with the --clean option, bootstrap removes files it generates. To
+# clean all autogenerated files (eg: for cvs imports) first run
+# make distclean, then bootstrap --clean
+# see bootstrapper(1) for more infor
+
+
+if test x"$1" = x"--help"; then
+ echo "$0: automatic bootstrapping utility for GNU Autotools"
+ echo " cleans up old autogenerated files and runs autoconf,"
+ echo " automake and aclocal on local directory"
+ echo
+ echo " --clean clean up auto-generated files without"
+ echo " creating new scripts"
+ echo
+ exit 0
+fi
+
+
+if [ -z "$NO_NEST" ];then
+ cd c && ./bootstrap $@; cd ..
+ cd cpp && ./bootstrap $@; cd ..
+fi
+
+
+ACLOCAL="aclocal"
+ACLOCAL_FILES="aclocal.m4"
+ALWAYS_CLEAN="config.status config.log config.cache libtool"
+AUTOCONF="autoconf"
+AUTOCONF_FILES="configure"
+AUTOHEADER="autoheader"
+AUTOHEADER_FILES=""
+AUTOMAKE="automake --add-missing --copy"
+AUTOMAKE_FILES="config.sub stamp-h.in ltmain.sh missing mkinstalldirs install-sh config.guess"
+CONFIG_AUX_DIR="."
+CONFIG_FILES="stamp-h ltconfig"
+CONFIG_HEADER=""
+if [ x`uname` = x"Darwin" ]; then
+ LIBTOOLIZE="glibtoolize --force --copy"
+else
+ LIBTOOLIZE="libtoolize --force --copy"
+fi
+LIBTOOLIZE_FILES="config.sub ltmain.sh config.guess"
+RM="rm"
+SUBDIRS="[]"
+
+
+# These are files created by configure, so we'll always clean them
+for i in $ALWAYS_CLEAN; do
+ test -f $i && \
+ $RM $i
+done
+
+if test x"$1" = x"--clean"; then
+ #
+ #Clean Files left by previous bootstrap run
+ #
+ if test -n "$CONFIG_AUX_DIR";
+ then CONFIG_AUX_DIR="$CONFIG_AUX_DIR/"
+ fi
+ # Clean Libtoolize generated files
+ for cf in $LIBTOOLIZE_FILES; do
+ cf="$CONFIG_AUX_DIR$cf"
+ test -f $cf && \
+ $RM $cf
+ done
+ #aclocal.m4 created by aclocal
+ test -f $ACLOCAL_FILES && $RM $ACLOCAL_FILES
+ #Clean Autoheader Generated files
+ for cf in $AUTOHEADER_FILES; do
+ cf=$CONFIG_AUX_DIR$cf
+ test -f $cf && \
+ $RM $cf
+ done
+ # remove config header (Usaually config.h)
+ test -n "$CONFIG_HEADER" && test -f $CONFIG_HEADER && $RM $CONFIG_HEADER
+ #Clean Automake generated files
+ for cf in $AUTOMAKE_FILES; do
+ cf=$CONFIG_AUX_DIR$cf
+ test -f $cf && \
+ $RM $cf
+ done
+ for i in $SUBDIRS; do
+ test -f $i/Makefile.in && \
+ $RM $i/Makefile.in
+ done
+ #Autoconf generated files
+ for cf in $AUTOCONF_FILES; do
+ test -f $cf && \
+ $RM $cf
+ done
+ for cf in $CONFIG_FILES; do
+ cf="$CONFIG_AUX_DIR$cf"
+ test -f $cf && \
+ $RM $cf
+ done
+else
+ $LIBTOOLIZE
+ $ACLOCAL
+ $AUTOHEADER
+ $AUTOMAKE
+ $AUTOCONF
+fi
+
+
diff --git a/c/AUTHORS b/c/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c/AUTHORS
diff --git a/c/ChangeLog b/c/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c/ChangeLog
diff --git a/c/Makefile b/c/Makefile
deleted file mode 100644
index d4b2226..0000000
--- a/c/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-
-CFLAGS = -I.. -Wall -g -O4
-LDFLAGS = -L.
-
-all: bench
-
-bench: pack.o unpack.o unpack_inline.o bench.o pack.h pack_inline.h unpack.h unpack_context.h
- $(CC) $(LDFLAGS) unpack.o unpack_inline.o pack.o bench.o -lyajl_s -o $@
-
-bench_inline: pack.o bench_inline.o pack.h pack_inline.h
- $(CC) $(LDFLAGS) pack.o bench_inline.o -lyajl_s -o $@
-
-.PHONY: clean
-clean:
- $(RM) unpack.o unpack_inline.o pack.o test.o bench.o bench_inline.o
- $(RM) bench bench_inline
-
diff --git a/c/Makefile.am b/c/Makefile.am
new file mode 100644
index 0000000..15cf753
--- /dev/null
+++ b/c/Makefile.am
@@ -0,0 +1,15 @@
+lib_LTLIBRARIES = libmsgpackc.la
+
+libmsgpackc_la_SOURCES = \
+ pack.c \
+ unpack.c \
+ unpack_inline.c
+
+nobase_include_HEADERS = \
+ msgpack/pack.h \
+ msgpack/unpack.h
+
+noinst_HEADERS = \
+ pack_inline.h \
+ unpack_context.h
+
diff --git a/c/NEWS b/c/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c/NEWS
diff --git a/c/README b/c/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c/README
diff --git a/c/bootstrap b/c/bootstrap
new file mode 100755
index 0000000..6a1e814
--- /dev/null
+++ b/c/bootstrap
@@ -0,0 +1,3 @@
+#!/bin/sh
+NO_NEST=1
+source ../bootstrap
diff --git a/c/configure.in b/c/configure.in
new file mode 100644
index 0000000..0f37460
--- /dev/null
+++ b/c/configure.in
@@ -0,0 +1,11 @@
+AC_INIT(pack.h)
+AM_INIT_AUTOMAKE(msgpackc, 0.1)
+AC_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+CFLAGS="-O4 $CFLAGS -Wall -I.."
+
+AC_OUTPUT([Makefile])
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..941168c
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(msgpack/unpack/inline_impl.h)
+AM_INIT_AUTOMAKE(msgpack, 0.1)
+AC_CONFIG_HEADER(config.h)
+
+AC_PROG_LIBTOOL
+#AC_CHECK_PROG(RUBY, ruby, ruby, [$PATH])
+
+AC_CONFIG_SUBDIRS([c cpp])
+AC_OUTPUT([Makefile])
+
diff --git a/cpp/AUTHORS b/cpp/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cpp/AUTHORS
diff --git a/cpp/ChangeLog b/cpp/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cpp/ChangeLog
diff --git a/cpp/Makefile b/cpp/Makefile
deleted file mode 100644
index 4a3677e..0000000
--- a/cpp/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-#CXXFLAGS = -I.. -I. -Wall -g
-CXXFLAGS = -I.. -I. -Wall -g -O4
-LDFLAGS = -L. $(CXXFLAGS)
-
-NEED_PREPROCESS = zone.hpp
-
-all: test bench
-
-%.hpp: %.hpp.erb
- erb $< > $@
-
-test: $(NEED_PREPROCESS) unpack.o unpack_inline.o object.o zone.o test.o object.hpp unpack.hpp pack.hpp
- $(CXX) $(LDFLAGS) unpack.o unpack_inline.o zone.o object.o test.o -o $@
-
-bench: $(NEED_PREPROCESS) unpack.o unpack_inline.o object.o zone.o bench.o object.hpp unpack.hpp pack.hpp
- $(CXX) $(LDFLAGS) unpack.o unpack_inline.o zone.o object.o bench.o -o $@
-
-.PHONY: clean
-clean:
- $(RM) unpack.o unpack_inline.o object.o zone.o
- $(RM) test.o test
- $(RM) bench.o bench
- $(RM) $(NEED_PREPROCESS)
-
diff --git a/cpp/Makefile.am b/cpp/Makefile.am
new file mode 100644
index 0000000..664f1ed
--- /dev/null
+++ b/cpp/Makefile.am
@@ -0,0 +1,20 @@
+lib_LTLIBRARIES = libmsgpack.la
+
+libmsgpack_la_SOURCES = \
+ object.cpp \
+ unpack.cpp \
+ unpack_inline.cpp \
+ zone.cpp
+
+nobase_include_HEADERS = \
+ msgpack/pack.hpp \
+ msgpack/unpack.hpp \
+ msgpack/object.hpp \
+ msgpack/zone.hpp
+
+noinst_HEADERS = \
+ unpack_context.hpp
+
+zone.hpp: zone.hpp.erb
+ erb $< > $@
+
diff --git a/cpp/NEWS b/cpp/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cpp/NEWS
diff --git a/cpp/README b/cpp/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cpp/README
diff --git a/cpp/bootstrap b/cpp/bootstrap
new file mode 100755
index 0000000..6a1e814
--- /dev/null
+++ b/cpp/bootstrap
@@ -0,0 +1,3 @@
+#!/bin/sh
+NO_NEST=1
+source ../bootstrap
diff --git a/cpp/configure.in b/cpp/configure.in
new file mode 100644
index 0000000..a94738a
--- /dev/null
+++ b/cpp/configure.in
@@ -0,0 +1,14 @@
+AC_INIT(object.hpp)
+AM_INIT_AUTOMAKE(msgpack, 0.1)
+AC_CONFIG_HEADER(config.h)
+
+AC_PROG_CXX
+AC_PROG_LIBTOOL
+AC_CHECK_PROG(ERB, erb, erb, [$PATH])
+
+AC_CHECK_LIB(stdc++, main)
+
+CXXFLAGS="-O4 $CXXFLAGS -Wall -I.."
+
+AC_OUTPUT([Makefile])
+
diff --git a/ruby/bench.rb b/ruby/bench.rb
index 1e6e27b..3b0b2ae 100644
--- a/ruby/bench.rb
+++ b/ruby/bench.rb
@@ -9,9 +9,9 @@ end
ary = []
i = 0
-while i < (1<<23)
- ary << (1<<23)
- #ary << i
+while i < (1<<24)
+ #ary << (1<<24)
+ ary << i
i += 1
end
@@ -23,10 +23,13 @@ a = Time.now
packed = MessagePack::pack(ary)
b = Time.now
show10(packed)
-puts "#{b-a} sec."
+sec = b - a
+puts "#{sec} sec."
+puts "#{packed.length.to_f / sec / 1024 / 1024 * 8} Mbps"
GC.start
+=begin
puts "----"
puts "JSON"
a = Time.now
@@ -37,6 +40,7 @@ puts "#{b-a} sec."
ary = nil
GC.start
+=end
puts "----"
@@ -44,17 +48,23 @@ puts "MessagePack"
a = Time.now
ary = MessagePack::unpack(packed)
b = Time.now
-puts "#{b-a} sec."
+sec = b - a
+puts "#{sec} sec."
+puts "#{packed.length.to_f / sec / 1024 / 1024 * 8} Mbps"
+
+p ary.size
+p (1<<24)
ary = nil
GC.start
+=begin
puts "----"
puts "JSON"
a = Time.now
ary = JSON::load(json)
b = Time.now
puts "#{b-a} sec."
-
+=end