activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r554241 - /activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp
Date Sat, 07 Jul 2007 18:57:41 GMT
Author: tabish
Date: Sat Jul  7 11:57:41 2007
New Revision: 554241

URL: http://svn.apache.org/viewvc?view=rev&rev=554241
Log:
http://issues.apache.org/activemq/browse/AMQCPP-128

Modified:
    activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp

Modified: activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp?view=diff&rev=554241&r1=554240&r2=554241
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-benchmarks/activemq/util/PrimitiveMapBenchmark.cpp
Sat Jul  7 11:57:41 2007
@@ -41,32 +41,64 @@
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveMapBenchmark::run() {
 
-    int numRuns = 500;
+    int numRuns = 750;
 
     for( int i = 0; i < numRuns; ++i ){
         map.setBool( "BOOL", true );
+        map.remove( "BOOL" );
         map.setByte( "BYTE", 12 );
+        map.remove( "BYTE" );
         map.setChar( "CHAR", 60 );
+        map.remove( "CHAR" );
         map.setInt( "INT", 54275482 );
+        map.remove( "INT" );
         map.setShort( "SHORT", 32767 );
+        map.remove( "SHORT" );
         map.setLong( "LONG", 0xFFLL );
+        map.remove( "LONG" );
         map.setDouble( "DOUBLE", 1321.1516 );
+        map.remove( "DOUBLE" );
         map.setFloat( "FLOAT", 45.45f );
+        map.remove( "FLOAT" );
         map.setString( "STRING", testString );
+        map.remove( "STRING"  );
         map.setByteArray( "BYTES", byteBuffer );
+        map.remove( "BYTES" );
     }
 
+    map.setBool( "BOOL", true );
+    map.setByte( "BYTE", 12 );
+    map.setChar( "CHAR", 60 );
+    map.setInt( "INT", 54275482 );
+    map.setShort( "SHORT", 32767 );
+    map.setLong( "LONG", 0xFFLL );
+    map.setDouble( "DOUBLE", 1321.1516 );
+    map.setFloat( "FLOAT", 45.45f );
+    map.setString( "STRING", testString );
+    map.setByteArray( "BYTES", byteBuffer );
+
+    bool boolResult = false;
+    unsigned char byteResult = 0;
+    char charResult = 0;
+    short shortResult = 0;
+    int intResult = 0;
+    long long longResult = 0;
+    float floatResult = 0.0f;
+    double doubleResult = 0.0;
+    std::string stringResult = "";
+    std::vector<unsigned char> bytesResult;
+
     for( int i = 0; i < numRuns; ++i ){
-        map.getBool( "BOOL" );
-        map.getByte( "BYTE" );
-        map.getChar( "CHAR" );
-        map.getInt( "INT" );
-        map.getShort( "SHORT" );
-        map.getLong( "LONG" );
-        map.getDouble( "DOUBLE" );
-        map.getFloat( "FLOAT" );
-        map.getString( "STRING" );
-        map.getByteArray( "BYTES" );
+        boolResult = map.getBool( "BOOL" );
+        byteResult = map.getByte( "BYTE" );
+        charResult = map.getChar( "CHAR" );
+        intResult = map.getInt( "INT" );
+        shortResult = map.getShort( "SHORT" );
+        longResult = map.getLong( "LONG" );
+        doubleResult = map.getDouble( "DOUBLE" );
+        floatResult = map.getFloat( "FLOAT" );
+        stringResult = map.getString( "STRING" );
+        bytesResult = map.getByteArray( "BYTES" );
     }
 
     for( int i = 0; i < numRuns; ++i ){



Mime
View raw message