Author: tabish
Date: Wed Sep 9 15:33:16 2009
New Revision: 812996
URL: http://svn.apache.org/viewvc?rev=812996&view=rev
Log:
New Benchmark for the Thread class.
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h
(with props)
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/BooleanBenchmark.cpp
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/testRegistry.cpp
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/Makefile.am
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/Makefile.am?rev=812996&r1=812995&r2=812996&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/Makefile.am
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/Makefile.am
Wed Sep 9 15:33:16 2009
@@ -22,6 +22,7 @@
decaf/io/DataInputStreamBenchmark.cpp \
decaf/io/DataOutputStreamBenchmark.cpp \
decaf/lang/BooleanBenchmark.cpp \
+ decaf/lang/ThreadBenchmark.cpp \
decaf/util/MapBenchmark.cpp \
decaf/util/PropertiesBenchmark.cpp \
decaf/util/QueueBenchmark.cpp \
@@ -38,6 +39,7 @@
decaf/io/DataInputStreamBenchmark.h \
decaf/io/DataOutputStreamBenchmark.h \
decaf/lang/BooleanBenchmark.h \
+ decaf/lang/ThreadBenchmark.h \
decaf/util/MapBenchmark.h \
decaf/util/PropertiesBenchmark.h \
decaf/util/QueueBenchmark.h \
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/BooleanBenchmark.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/BooleanBenchmark.cpp?rev=812996&r1=812995&r2=812996&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/BooleanBenchmark.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/BooleanBenchmark.cpp
Wed Sep 9 15:33:16 2009
@@ -27,7 +27,7 @@
////////////////////////////////////////////////////////////////////////////////
void BooleanBenchmark::run(){
- int numRuns = 1000;
+ int numRuns = 8000;
Boolean boolean( false );
std::string value = "";
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp?rev=812996&view=auto
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp
(added)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp
Wed Sep 9 15:33:16 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ThreadBenchmark.h"
+
+#include <decaf/lang/Runnable.h>
+
+using namespace decaf;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+namespace decaf{
+namespace lang{
+
+ class BenchmarkRunnable : public decaf::lang::Runnable {
+ public:
+
+ virtual void run() {
+ Thread::sleep( 10 );
+ }
+
+ };
+
+}}
+
+////////////////////////////////////////////////////////////////////////////////
+ThreadBenchmark::ThreadBenchmark() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ThreadBenchmark::~ThreadBenchmark() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ThreadBenchmark::run() {
+
+ BenchmarkRunnable runnable;
+
+ for( int i = 0; i < 10; ++i ) {
+ Thread theThread( &runnable );
+ theThread.start();
+ theThread.join();
+ }
+}
Propchange:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h?rev=812996&view=auto
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h
(added)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h
Wed Sep 9 15:33:16 2009
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_LANG_THREADBENCHMARK_H_
+#define _DECAF_LANG_THREADBENCHMARK_H_
+
+#include <benchmark/BenchmarkBase.h>
+#include <decaf/lang/Thread.h>
+
+namespace decaf {
+namespace lang {
+
+ class ThreadBenchmark : public benchmark::BenchmarkBase<
decaf::lang::ThreadBenchmark, Thread >{
+ public:
+
+ ThreadBenchmark();
+ virtual ~ThreadBenchmark();
+
+ virtual void run();
+
+ };
+
+}}
+
+#endif /* _DECAF_LANG_THREADBENCHMARK_H_ */
Propchange:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/lang/ThreadBenchmark.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/testRegistry.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/testRegistry.cpp?rev=812996&r1=812995&r2=812996&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/testRegistry.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/testRegistry.cpp
Wed Sep 9 15:33:16 2009
@@ -23,6 +23,8 @@
#include <decaf/lang/BooleanBenchmark.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanBenchmark );
+#include <decaf/lang/ThreadBenchmark.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadBenchmark );
#include <decaf/util/PropertiesBenchmark.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::PropertiesBenchmark );