diff --git a/Code/Mantid/Build/CMake/FindCxxTest.cmake b/Code/Mantid/Build/CMake/FindCxxTest.cmake
index 21802e300bb7e0f00ae51e5882932d0bf46391fa..2ab1377fb7e0e1b6235d57ff3928438dcb38e6f6 100644
--- a/Code/Mantid/Build/CMake/FindCxxTest.cmake
+++ b/Code/Mantid/Build/CMake/FindCxxTest.cmake
@@ -90,8 +90,9 @@
 #     Eliminated superfluous CXXTEST_FOUND assignment
 #     Cleaned up and added more documentation
 
+
 #=============================================================
-# CXXTEST_ADD_TEST (public macro)
+# CXXTEST_ADD_TEST (public macro to add unit tests)
 #=============================================================
 macro(CXXTEST_ADD_TEST _cxxtest_testname)
     # determine the cpp filename
@@ -135,19 +136,42 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname)
       add_test ( NAME ${_cxxtest_testname}
                  COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing" 
                          $<TARGET_FILE:${_cxxtest_testname}> )
+
     else (CXXTEST_SINGLE_LOGFILE)
       # THE FOLLOWING DESTROYS THE OUTPUT XML FILE
       # add each separate test to ctest
       foreach ( part ${ARGN} )
+		# The filename without extension = The suite name.
         get_filename_component(_suitename ${part} NAME_WE )
         set( _cxxtest_separate_name "${_cxxtest_testname}_${_suitename}")
         add_test ( NAME ${_cxxtest_separate_name}
                   COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing" 
 		          $<TARGET_FILE:${_cxxtest_testname}> ${_suitename} )
+
+		if (CXXTEST_ADD_PERFORMANCE)
+			# ------ Performance test version -------
+			# Name of the possibly-existing Performance test suite
+			set( _performance_suite_name "${_suitename}Performance" )
+			# Read the contents of the header file
+		    FILE( READ ${part} _file_contents )
+			# Is that suite defined in there at all?
+			STRING(REGEX MATCH ${_performance_suite_name} _search_res ${_file_contents} )
+			if (NOT "${_search_res}" STREQUAL "")
+				#MESSAGE( "${_performance_suite_name} Found:                 ${_search_res}" ) 
+				set( _cxxtest_separate_name "${_cxxtest_testname}_${_performance_suite_name}")
+				add_test ( NAME ${_cxxtest_separate_name}
+				          COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing" 
+						  $<TARGET_FILE:${_cxxtest_testname}> ${_performance_suite_name} )
+			endif ()
+		endif ()
       endforeach ( part ${ARGN} )
     endif (CXXTEST_SINGLE_LOGFILE)
 endmacro(CXXTEST_ADD_TEST)
 
+
+
+
+
 #=============================================================
 # main()
 #=============================================================
diff --git a/Code/Mantid/CMakeLists.txt b/Code/Mantid/CMakeLists.txt
index e58e53cdbb8b3230be37546d2fe65efad34b4332..e48d7271c5825b85e364b8ed0f718189a679f3af 100644
--- a/Code/Mantid/CMakeLists.txt
+++ b/Code/Mantid/CMakeLists.txt
@@ -77,6 +77,7 @@ add_subdirectory ( MantidPlot )
 set ( MAKE_VATES OFF CACHE BOOL "Switch for compiling the Vates project")
 set ( MAKE_MDEVENTS OFF CACHE BOOL "Switch for compiling the MDEvents project")
 set ( CXXTEST_SINGLE_LOGFILE CACHE BOOL "Switch to have the tests for each package run together")
+set ( CXXTEST_ADD_PERFORMANCE OFF CACHE BOOL "Switch to add Performance tests to the list of tests run by ctest?") 
 
 if ( MAKE_VATES )
   add_subdirectory ( Vates )
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h
index 25588d4d1014733cfe3f53aab00de3e70062ba4d..bb0b709c9b09c3c56560482438df3597b6ba25b1 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h
@@ -59,7 +59,7 @@ namespace Mantid
             /// overwrite IFunction base class methods
             std::string name()const{return "CobaltSpinWaveDSHO";}
             /// sqwBroad returns the expected scattering weight for the given Q,w point
-            virtual double CobaltSpinWaveDSHO::sqwBroad(const std::vector<double> & point, const std::vector<double> & fgParams,
+            virtual double sqwBroad(const std::vector<double> & point, const std::vector<double> & fgParams,
                     const double temp, const Geometry::Matrix<double> & ubinv) const;
            
         protected:
diff --git a/Code/Mantid/Framework/MDEvents/test/BinToMDHistoWorkspaceTest.h b/Code/Mantid/Framework/MDEvents/test/BinToMDHistoWorkspaceTest.h
index af60e0270f6427746597513623bae7bd5d1c2b10..c026abd86a84db6182c18c8f0a17368b8894b0a2 100644
--- a/Code/Mantid/Framework/MDEvents/test/BinToMDHistoWorkspaceTest.h
+++ b/Code/Mantid/Framework/MDEvents/test/BinToMDHistoWorkspaceTest.h
@@ -167,6 +167,46 @@ public:
     //TS_ASSERT_EQUALS(out->getNPoints(), 0); //TODO. Janik. This needs to be fixed. The implicit function should have ensured that no bins were present.
   }
 
+};
+
+
+class BinToMDHistoWorkspaceTestPerformance : public CxxTest::TestSuite
+{
+public:
+  MDEventWorkspace3::sptr in_ws;
+
+  void setUp()
+  {
+    in_ws = MDEventsHelper::makeMDEW<3>(10, 0.0, 10.0, 1000);
+    // 1000 boxes with 1000 event each
+    TS_ASSERT_EQUALS( in_ws->getNPoints(), 1000*1000);
+    in_ws->splitAllIfNeeded(NULL);
+    AnalysisDataService::Instance().addOrReplace("BinToMDHistoWorkspaceTest_ws", in_ws);
+  }
+
+  void tearDown()
+  {
+    AnalysisDataService::Instance().remove("BinToMDHistoWorkspaceTest_ws");
+  }
+
+  /** A slow test that is useful for profiling and optimizing */
+  void test_for_profiling()
+  {
+    for (size_t i=0; i<1; i++)
+    {
+      BinToMDHistoWorkspace alg;
+      TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+      TS_ASSERT( alg.isInitialized() )
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("InputWorkspace", "BinToMDHistoWorkspaceTest_ws") );
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("DimX", "Axis0,2.0,8.0, 60"));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("DimY", "Axis1,2.0,8.0, 60"));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("DimZ", "Axis2,2.0,8.0, 60"));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("DimT", "NONE,0.0,10.0,1"));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "BinToMDHistoWorkspaceTest_ws_histo"));
+      TS_ASSERT_THROWS_NOTHING( alg.execute(); )
+      TS_ASSERT( alg.isExecuted() );
+    }
+  }
 
 };