| From: | Chris <chris(at)bitmead(dot)com> | 
|---|---|
| To: | Postgres Hackers List <hackers(at)postgresql(dot)org> | 
| Subject: | Re: [HACKERS] Patch attached... | 
| Date: | 2000-02-05 11:55:12 | 
| Message-ID: | 389C0FA0.488FCC8C@bitmead.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(at)bitmead(dot)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);
}
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Hannu Krosing | 2000-02-05 12:00:52 | Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL | 
| Previous Message | Hannu Krosing | 2000-02-05 11:47:50 | Re: [HACKERS] Patch attached... |