[postgis-devel] Optimizing contains/within

Robert W. Burgholzer rburghol at vt.edu
Mon Jul 23 13:53:21 PDT 2007


Thanks Charlie, I will check into Valgrind.

r.b.

Quoting Charlie Savage <cfis at savagexi.com>:

> Hi Robert,
>
> > I am looking at the geos code for the contains calls for a point in a
> > multipolygon, which appears to boil down to the function:
> >
> > point_in_ring(POINTARRAY *pts, POINT2D *point)
>
> Have you profiled your program?  If not, then the first step it to
> figure out what is slow.  If you have access to a Linux box then run
> your program under Valgrind (it has a profiler) and it will tell you
> *exactly* what is slow.  In a large code base like GEOS, its almost
> impossible to know where the bottlenecks are by just eyeballing the
> code.  Just because a function is called a million times doesn't
> necessarily make it the bottleneck.
>
> Once you know which function, and which line is slow, then its becomes
> much easier to fix the problem.
>
> Charlie
>
>


--
Robert W. Burgholzer
--
Finding the occasional straw of truth awash in a great ocean of confusion and
bamboozle requires intelligence, vigilance, dedication and courage.  But if we
don't practice these tough habits of thought, we cannot hope to solve the truly
serious problems that face us -- and we risk becoming a nation of suckers, up
for grabs by the next charlatan who comes along.
-- Carl Sagan, "The Fine Art of Baloney Detection," Parade, February 1, 1987

Online Workout Editor:
http://www.swat-swimming.org/workoutlog/
http://soulswimmer.dynalias.net/



More information about the postgis-devel mailing list