Re: Memory buffer alignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Memory buffer alignment
Date: 2003-09-18 21:46:34
Message-ID: 3149.1063921594@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Manfred Spraul <manfred(at)colorfullife(dot)com> writes:
> Unfortunately it's the slower one: Intel cpus have a microcode fastpath
> for memcopies that are 8-byte aligned. This fastpath is around 50%
> faster than the manual copy that is used for "misaligned" (i.e. only
> 4-byte aligned) pointers.

Maybe it'd be worth setting MAXIMUM_ALIGNOF to 8 on such CPUs? Or at
least hacking ShmemAlloc and friends to use 8-byte alignment. I assume
the major issue here is that the shared buffers don't get 8-byte-aligned
within the shared memory segment.

Are there any machines where it'd be worth forcing an even larger
alignment for the buffers?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2003-09-18 22:17:58 Re: 7.4beta2 vs 7.3.3
Previous Message Carlos Guzman Alvarez 2003-09-18 21:39:56 Array Parameters on protocol 3.0