Re: Some platform-specific MemSet research

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Seneca Cunningham <scunning(at)ca(dot)afilias(dot)info>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Some platform-specific MemSet research
Date: 2006-01-24 22:49:46
Message-ID: 20060124224946.GC18870@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2006-01-24 23:54:41 Re: Cleaning up the INET/CIDR mess
Previous Message Seneca Cunningham 2006-01-24 22:24:28 Some platform-specific MemSet research