Re: [HACKERS] gperf anyone?

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] gperf anyone?
Date: 2000-01-19 01:49:28
Message-ID: 3.0.1.32.20000118174928.00ef0370@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 07:36 PM 1/18/00 -0500, Bruce Momjian wrote:
>[Charset ISO-8859-1 unsupported, filtering to ASCII...]
>> A while ago I played around with gperf (GNU perfect hash function
>> generator), abusing the keyword lookup in parser/keyword.c as playground.
>> Now before I delete this I was wondering if this would perhaps be of use
>> to the general public. I don't know how huge the speed advantage of this
>> is, I'm sure the parser/scanner speed is the least of our problems. But I
>> thunk especially ecpg could benefit from this. Btw., gperf is used by GCC,
>> so it's not a toy.
>
>keywords are a fixed array, with a binary search to find a match. Could
>gperf be faster? We also can not distribute GNU code.

I wondered about this last, i.e. the use of GNU code since Postgres
is licensed differently.

The reality is that looking up keywords form a tiny fraction of the
time spent by any language system I can think of. The current binary
search on a fixed array might be faster, might be slower than a perfect
hash on a particular machine depending on the calculation done to
do the hashing.

Whether faster or slower, though, I can't imagine either method taking
noticably more than 0% of the total time to process a query, even the
most simple queries.

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-01-19 01:50:50 Re: [HACKERS] Index recreation in vacuum
Previous Message Tatsuo Ishii 2000-01-19 01:48:50 Re: [HACKERS] multi-byte support broken in current