[postgis-devel] Optimizing contains/within
cfis at savagexi.com
Mon Jul 23 13:49:47 PDT 2007
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
More information about the postgis-devel