Subject: CGAL users discussion list
List archive
- From: Gueroult Renaud <>
- To:
- Subject: Speed issue
- Date: Mon, 11 Jun 2007 13:43:09 +0200
Hi CGAL users and developpers,
I've got a speed issue running some polygons operations. Using the
CGAL-3.3 in release with CGAL_NO_ASSERTIONS and CGAL_NO_PRECONDITIONS, I
get an approximate computation time of 15 seconds for 1000 intersections
of really simple polygons on a windows OS under VS2005. I tried it
using cygwin (liux environment for windows) with the same computer and
the same operation takes approximately 4 sec. Unfortunately I'd like to
keep developping under windows and VS2005 because I'm using others
library I don't want to implement with cygwin.
If someone would like to see the options of the VS2005 project, tell me
and I would be please to send it to him.
I tried with various kernels, it certainly has an impact on the
computation time, but that is definitely not the explanation for this
huge difference.
Best regards,
Renaud
Below is the code sample:
/#include "stdafx.h"
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/Boolean_set_operations_2.h>
#include <iostream>
#include "time.h"
#include "bso_rational_nt.h"
typedef CGAL::Cartesian<double> K;
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
typedef std::list<Polygon_with_holes_2> Pwh_list_2;
using std::cout; using std::endl;
int main()
{
Polygon_2 P3,P4;
P3.push_back(Point_2(0,0));
P3.push_back(Point_2(1,0));
P3.push_back(Point_2(1,1));
P3.push_back(Point_2(0,1));
P4.push_back(Point_2(0.5,0.5));
P4.push_back(Point_2(1.5,0.5));
P4.push_back(Point_2(1.5,1.5));
P4.push_back(Point_2(0.5,1.5));
Polygon_with_holes_2 UnionR;
Pwh_list_2 intR;
int i,j;
time_t Start_t, End_t;
int time_task1;
FILE *out = fopen("D:\\code\\TimeTestFromScratch\\Test.txt","w");
for (i=0;i<5;i++)
{
Start_t = time(NULL);
for (j=0;j<1000;j++)
{ //UnionR.clear();
//CGAL::join(P3,P4,UnionR);
intR.clear();
CGAL::intersection(P3,P4,std::back_inserter(intR));
}
End_t = time(NULL);
time_task1 = difftime(End_t, Start_t);
fprintf(out,"Elpased : %d\n",time_task1);
}
return 1;
}/
--
------------------------------------------------------
/Renaud Gueroult/
<mailto:>
- Speed issue, Gueroult Renaud, 06/11/2007
- Re: [cgal-discuss] Speed issue, Andreas Fabri, 06/11/2007
- Re: [cgal-discuss] Speed issue, Gueroult Renaud, 06/11/2007
- Re: [cgal-discuss] Speed issue, Andreas Fabri, 06/11/2007
- Re: [cgal-discuss] Speed issue, Gueroult Renaud, 06/11/2007
- Re: [cgal-discuss] Speed issue, Efi Fogel, 06/12/2007
- Re: [cgal-discuss] Speed issue, Gueroult Renaud, 06/13/2007
- Re: [cgal-discuss] Speed issue, Efi Fogel, 06/12/2007
- Re: [cgal-discuss] Speed issue, Gueroult Renaud, 06/11/2007
- Re: [cgal-discuss] Speed issue, Andreas Fabri, 06/11/2007
- Re: [cgal-discuss] Speed issue, Gueroult Renaud, 06/11/2007
- Re: [cgal-discuss] Speed issue, Andreas Fabri, 06/11/2007
Archive powered by MHonArc 2.6.16.