Re: [HACKERS] Patch attached... - Mailing list pgsql-hackers

From Chris
Subject Re: [HACKERS] Patch attached...
Date
Msg-id 389C0FA0.488FCC8C@bitmead.com
Whole thread Raw
In response to Re: [HACKERS] Patch attached...  (Don Baccus <dhogaza@pacifier.com>)
List pgsql-hackers
Hannu Krosing wrote:

> Btw, how did you measure that 30us  overhead ?

I measured it with the test program below. With the latest patch it is
no longer 30us, but as far as I can measure 0us.
> Does it involve disk accesses or is it just 
> in-memory code that
> speed-concious folks could move to assembly like current
> spinlocking code for some architectures?

For this patch it is an in-memory issue.

-- 
Chris Bitmead
mailto:chris@bitmead.com

#include <stdio.h>
#include <time.h>
#include "libpq-fe.h"

#define rep 1000000


main() {
int c;
PGconn *conn;
PGresult *res;
time_t t, t2;

conn = PQsetdb(NULL,NULL,NULL,NULL,"foo");
time(&t);
for (c = 0; c < rep; c++) {       res = PQexec(conn, "select * from a*");       PQclear(res);
}
time(&t2);
printf("inh %d\n", t2 - t);
time(&t);
for (c = 0; c < rep; c++) {       res = PQexec(conn, "select * from only a");       PQclear(res);
}
time(&t2);
printf("no inh %d\n", t2 - t);

PQfinish(conn);

}


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL
Next
From: Hannu Krosing
Date:
Subject: Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL