Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] regex (from TODO)

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: zakkr(at)zf(dot)jcu(dot)cz
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] regex (from TODO)
Date: 2000-03-09 01:10:11
Message-ID: 20000309101011B.t-ishii@sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
>  In the PostgreSQL TODO is "Get faster regex() code from Henry Spencer..".
> 
>  I look at current available regex used (a example) in apache, php, .etc. But
> if I look at changes (via diff) between PostgreSQL's regex and more new
> regex in PHP4 it is very same. A differentions are that in new regex code
> are all values marks as 'register' and this new regex not support MULTIBYTE.

Actually Henry has never supported MULTIBYTE:-) We modified his code
so that we could support it.

> It is without any relevant changes (or 'register' is really fastly?).

I vaguely recall that we decided that 'register' did nothing good with
modern compilers, and it'd be better to let the optimizer determine
what variables should be assigned to registers.

>  What means TODO? 

That means "get faster code from Henry and modify it if it does not
support MULTIBYTE" -- I guess.

>  The PG's regex use malloc -- why not MemoryContext?

Probably because the regex caches the results of regcomp in a static
area which points to a malloced memory allocated while compiling a
regular expression. However, for the regexec stage we might be able to
use palloc instead of malloc. I'm not sure if this would result in a
any better performance, though.
--
Tatsuo Ishii

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2000-03-09 02:00:56
Subject: Re: [HACKERS] DROP TABLE inside a transaction block
Previous:From: Tom LaneDate: 2000-03-09 01:04:48
Subject: Re: [HACKERS] Transaction abortions & recovery handling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group