Re: Some platform-specific MemSet research - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Some platform-specific MemSet research
Date
Msg-id 20060124224946.GC18870@svana.org
Whole thread Raw
In response to Some platform-specific MemSet research  (Seneca Cunningham <scunning@ca.afilias.info>)
Responses Re: Some platform-specific MemSet research  (Seneca Cunningham <scunning@ca.afilias.info>)
List pgsql-hackers
On Tue, Jan 24, 2006 at 05:24:28PM -0500, Seneca Cunningham wrote:
> After reading the post on -patches proposing that MemSet be changed to
> use long instead of int32 on the grounds that a pair of x86-64 linux
> boxes took less time to execute the long code 64*10^6 times[1], I took a
> look at how the testcode performed on AIX with gcc.  While the switch to
> long did result in a minor performance improvement, dropping the
> MemSetLoop in favour of the native memset resulted in the tests taking
> ~25% the time as the MemSetLoop-like int loop. The 32-bit linux system I
> ran the expanded tests on showed that for the buffer size range that
> postgres can use the looping MemSet instead of memset (size <= 1024
> bytes), MemSet generally had better performance.

Could you please check the asm output to see what's going on. We've had
tests like these produce odd results in the past because the compiler
optimised away stuff that didn't have any effect. Since every memset
after the first is a no-op, you want to make sure it's still actually
doing the work...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Seneca Cunningham
Date:
Subject: Some platform-specific MemSet research
Next
From: Andrew - Supernews
Date:
Subject: Re: Cleaning up the INET/CIDR mess