sbufdesc' padding... - Mailing list pgsql-hackers

From Vadim Mikheev
Subject sbufdesc' padding...
Date
Msg-id 36622819.FDB4B8DF@krs.ru
Whole thread Raw
Responses Re: [HACKERS] sbufdesc' padding...  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
I'm going to remove subj...

buf_internals.h:
   /*    * I padded this structure to a power of 2 (PADDED_SBUFDESC_SIZE)    * because BufferDescriptorGetBuffer is
calleda billion times and it    * does an C pointer subtraction (i.e., "x - y" -> array index of x    * relative to y,
whichis calculated using division by struct size).
^^^^^^^^^^^^^^^^^^^^^^^^   * Integer ".div" hits you for 35 cycles, as opposed to a 1-cycle    * "sra" ... this hack
cut10% off of the time to create the Wisconsin    * database! It eats up more shared memory, of course, but we're    *
(allegedly)going to make some of these types bigger soon anyway...    * -pma 1/2/93    */
 

This is not true now:

#define BufferDescriptorGetBuffer(bdesc) ((bdesc)->buf_id + 1)

Comments ?...

Vadim


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [HACKERS] How to see rules,functions and triggers in psql ?
Next
From: Akmal Hasan
Date:
Subject: How to build Distributed Databases with JDBC and PostgreSQL?