[postgis-devel] contains optimization
dfuhry at cs.kent.edu
Thu Jul 26 08:05:23 PDT 2007
Your proposed change is called inlining . A compiler is smart
enough to automatically inline such small functions directly into the
code of point_in_ring. Manual inlining can make code harder to read &
maintain. As Charlie suggested earlier , you should profile the
code to see if this is really a bottleneck.
For optimizations, pre-change & post-change performance numbers are
what's needed to convince people that the change is worthwhile.
Robert W. Burgholzer wrote:
> I am running this by the list first, before I try it myself to get feedback. I
> will try it on my machine then post results. Once again, I am a green C coder,
> and thus, am just making these attempts based on googled optimization
> I have seen that it is advised to NOT make function calls within loops as they
> add to overhead, so I am proposing to move the function:
> determineSide(POINT2D *seg1, POINT2D *seg2, POINT2D *point)
> into the calling function:
> point_in_ring(POINTARRAY *pts, POINT2D *point)
> since it is only a one line function anyhow, and should not muddy up the code.
> 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:
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
More information about the postgis-devel