[geos-devel] gprof (missing attachment)

Norman Vine nhv at cape.com
Sun Feb 6 06:25:09 EST 2005


strk at refractions.net writes:
>
> The top-most functions are Envelope::intersects and AbstractSTRtree::query.
> Next come iterators.

< untested >
This might be a little faster in that it allows for early outs  :-)

bool Envelope::intersects(const Coordinate& p1,const Coordinate& p2,const Coordinate& q1,const Coordinate& q2) {
    if( min(p1.x,p2.x) > max(q1.x,q2.x) ||
          max(p1.x,p2.x) < min(q1.x,q2.x) ||
          min(p1.y,p2.y) > max(q1.y,q2.y) ||
          max(p1.y,p2.y) < min(q1.y,q2.y) )
		return false;
	return true;
}

Might be worth testing both Intersects as inlines also

Norman



More information about the geos-devel mailing list