[postgis-devel] Alignment Revision

strk strk at keybit.net
Wed Jan 21 04:29:40 PST 2009


On Wed, Jan 21, 2009 at 11:37:53AM +0000, Mark Cave-Ayland wrote:

> Yes. Please see my original post and test harness here: 
> http://lists.refractions.net/pipermail/postgis-devel/2009-January/004473.html. 
>  Even with a memcpy() from unaligned to aligned space, the speed difference 
> is quite impressive.

I suggest you add a test using getPoint_internal on unaligned
memory. The rational here is that IFF the architecture doesn't
required aligned memory, we might still use getPoint_internal
in there w/out changing the structure (and possibly with not-so-big
overhead due to non-aligned reads).

In other words, I'm not convinced that the performance penalty
comes from aligned vs. unaligned, but mostly from the additional
function calls (memcpy) required at each iteration.

> It may be worth you playing with the testmem.c harness in the above 
> email to see whether it has a similar performance effect when accessing 
> rasters.

I guess it really depends on use cases, the accesses could
be optimized based on the operation. For example, if the
function only needs to return a given point (say pointN)
a single memcpy (per value) won't be a big problem, while if
it needs to scan the whole thing a single memcpy (per pointarray)
might not be a big problem.

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 



More information about the postgis-devel mailing list