Boost logo

Boost-Commit :

From: mariano.consoni_at_[hidden]
Date: 2008-05-22 16:01:44


Author: mconsoni
Date: 2008-05-22 16:01:43 EDT (Thu, 22 May 2008)
New Revision: 45666
URL: http://svn.boost.org/trac/boost/changeset/45666

Log:
- Some parameters were changed to fit in the comparison with GEOS version.

Text files modified:
   sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp | 15 +++++++++++----
   1 files changed, 11 insertions(+), 4 deletions(-)

Modified: sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp (original)
+++ sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp 2008-05-22 16:01:43 EDT (Thu, 22 May 2008)
@@ -59,6 +59,8 @@
         std::vector<unsigned int> ids;
          std::vector<std::pair<double, double> > points = read_data();
 
+ time_t start;
+
 // std::cerr << "Size: " << points.size() << std::endl;
 
         // plane
@@ -68,7 +70,7 @@
          const double max_y = 80.0;
 
         // number of points to find on the search phase
- const unsigned int find_count = 1000;
+ const unsigned int find_count = 100000;
 
          for(unsigned int i = 0; i < points.size(); i++) {
                  ids.push_back(i);
@@ -83,7 +85,10 @@
            std::vector<unsigned int>::iterator b, e;
            b = ids.begin();
            e = ids.end();
+
+ start = time(NULL);
            q->bulk_insert(b,e, points);
+ std::cerr << "Insertion time: " << time(NULL) - start << " seconds." << std::endl;
 
         // search
         std::vector<std::pair<double,double> > search_positions;
@@ -95,14 +100,16 @@
                 search_data.push_back(pos);
         }
 
+ start = time(NULL);
         for(unsigned int j=0; j < find_count; j++) {
                 std::vector<unsigned int>::iterator it = q->find(search_positions[j]);
- std::cout << search_data[j]
- << " - found in (" << search_positions[j].first << "," << search_positions[j].second << ") --> "
- << *it << std::endl;
+// std::cout << search_data[j]
+// << " - found in (" << search_positions[j].first << "," << search_positions[j].second << ") --> "
+// << *it << std::endl;
 
                 BOOST_CHECK_EQUAL(*it, search_data[j]);
         }
+ std::cerr << "Retrieve time: " << time(NULL) - start << " seconds." << std::endl;
 
         return 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk