Subject: CGAL users discussion list
List archive
- From: Gueroult Renaud <>
- To:
- Subject: Re: [cgal-discuss] Speed issue
- Date: Wed, 13 Jun 2007 12:26:43 +0200
Thanks a lot for your help.
Apparently I had a mistunderstanding of the settings. Now it works fine and fast.
Thanks again.
Renaud
Efi Fogel a écrit :
I've tried it myself on a Windows machine (AMD Athlon 64x2 Core Processor 3800+ 2.01GHz, 1GB RAM). I did change the storage type of time_task1 to double. When compiled without optimization I got the following:
Elpased: 3
Elpased: 3
Elpased: 2
Elpased: 3
Elpased: 2
after I adding "-DNDEBUG /Ox /O2" to the compilation command line, I got:
Elpased: 0
Elpased: 1
Elpased: 0
Elpased: 1
Elpased: 0
The entire command lines were:
"cl.exe" -TP -GR -EHsc -Zm900 -nologo -MD -DCGAL_NO_AUTOLINK
'-Ic:/CGAL/CGAL-3.3-I/include' '-Ic:/boost/include/boost-1_33_1' -DNDEBUG -Ox -O2 -c bso.cpp
"cl.exe" -Febso bso.obj -link '-LIBPATH:c:/CGAL/CGAL-3.3-I/lib'
-nologo CGAL.lib CGALPDB.lib mpfr.lib gmp.lib psapi.lib
You will still have to sort out the GMP issue, but at least these results should give you confidence that there are no fundamental problem on Windows.
Gueroult Renaud wrote:
Andreas Fabri a écrit :
Gueroult Renaud wrote:I was not using the CGAL_USE_GMP preprocessor definition, I tried it but unfortuantely it doesn't improve the computation time.
Yes the VC2005 project options are release, O2 and I had the NDEBUG flag on for the time given previously.
If I change this flag to DNDEBUG it takes about 18 seconds to make 1000 intersections in release under windows with O2.
Thanks for your help. I'm at your disposal if you need anything else.
Did you define CGAL_USE_GMP ? Otherwise
the exact predicates exact constructions kernel
might use another multi precision integer
number type under the hood.
Do you use the same GMP for VC8 and cygwin?
The precompiled version that comes with the
windows installer doesn't use processor specific
optimisations, that is no assembler routines.
andreas
On the other hand, I can't really tell if I'm using the same GMP for VC and cygwin. The one I use with VC8 is the precompiled one which come directly with the windows installer (I didn't do anything on that side). With cygwin, I installed CGAL as explained in the manual, so I don't really now how does it work, all I know is that I was not using the flag neither.
Do you think there's something to do on windows with GMP?
Renaud
Andreas Fabri a écrit :
Did you -O2 -DNDEBUG
andreas
Gueroult Renaud wrote:
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:>
/Peter Heppel Associates/
Design-Engineering-Mathematics
www.peterheppel.com <http://www.peterheppel.com>
- 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.