Re: Fix quadratic performance of regexp match/split functions

2018-08-15 Thread Andrew Gierth
> "Kaiting" == Kaiting Chen writes: Kaiting> I'll do some more testing to determine how this behaves in the Kaiting> presence of multibyte characters in UTF-8. Excellent, thanks! -- Andrew (irc:RhodiumToad)

Re: Fix quadratic performance of regexp match/split functions

2018-08-15 Thread Kaiting Chen
Applied cleanly for me. Here are my performance test results: count - 300 (1 row) Time: 3167.836 ms (00:03.168) count -- 1010 (1 row) Time: 6074.369 ms (00:06.074) count --- 10001 (1 row) Time: 8.159 ms The performance improves substantially in case 2 as adv

Re: Fix quadratic performance of regexp match/split functions

2018-08-15 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Patch take 2. Changes: 1. Remove cleanup function with retail pfree()s; this was added in commit ae65ca312 (Aug 2007) to fix an actual memory leak, but obsoleted by commit ff428cded (Feb 2008); since then, the pfrees were pointless since all the freed obje

Fix quadratic performance of regexp match/split functions

2018-08-12 Thread Andrew Gierth
While poking at that xml issue I tried to compare the memory usage of the xml queries with vaguely comparable regexp_split_to_table queries, and found that I could not do so; the regexp queries simply did not complete in any sensible timeframe. Investigation showed that in UTF8 (or other multibyte