Re: Test harness for regex code (to allow importing Tcl's test suite) - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Test harness for regex code (to allow importing Tcl's test suite)
Date
Msg-id 331c0e91-f151-4766-b526-cc2c9f84d5d7@www.fastmail.com
Whole thread Raw
In response to Test harness for regex code (to allow importing Tcl's test suite)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Jan 4, 2021, at 04:49, Tom Lane wrote:
>Over the holiday break I've been fooling with some regex performance
>improvements.

Cool! I've also been fooling with regex performance over the years myself, not in the PostgreSQL code, but in general.

More specifically, to first DFA-minimize the regex,
and then to generate LLVMIR directly from the graph.

Perhaps some of the ideas could be interesting to look at.


One idea that I came up with myself is the "merge_linear" step,
where when possible, multiple characters are read in the same operation.
Not sure if other regex JIT engines does this, but it makes quite a difference
for large regexes where you have long strings.

Note: There is no support for capture groups, back-references, etc, but | + * () [] [^] works.

/Joel

pgsql-hackers by date:

Previous
From: Amine Tengilimoglu
Date:
Subject: Re: pg_rewind restore_command issue in PG12
Next
From: Bharath Rupireddy
Date:
Subject: Re: Parallel Inserts in CREATE TABLE AS