Re: [HACKERS] Patch attached...

Поиск
Список
Период
Сортировка
От Chris
Тема Re: [HACKERS] Patch attached...
Дата
Msg-id 389C0FA0.488FCC8C@bitmead.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Patch attached...  (Don Baccus <dhogaza@pacifier.com>)
Список 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 по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL