model-writtenrun 9802 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Heikki Linnakangas proposed replacing wchar conversion with byte-oriented searching to improve common multibyte searches and remove the allocation barrier for inputs above 256 MB, using character-boundary validation where necessary and separate pointer and character-offset APIs #1.
- Kyotaro Horiguchi confirmed that EUC_JP can produce matches inside multibyte characters, supported restricting the boundary-check exemption to UTF-8 initially, and asked whether character counting could happen during searching #2.
- After Dmitry Dolgov reported an assertion-build compilation failure #3, John Naylor supplied a revision fixing the start_ptr spelling and reported initial performance measurements #4, then discovered a citext regression-test failure #5.
- Heikki found that John's benchmark was measuring cached constants and supplied a separate C benchmark helper; corrected measurements exposed substantial worst-case regressions and a pathological UTF-8 skip-table collision, but he considered the common-case benefits worthwhile #6.
- Heikki reproduced the citext failure with assertions enabled #8 and revised the optimization so callers handle empty inputs before invoking text_position_setup #9.
- Following Tomas Vondra's request for representative performance evidence #10, John tested different match positions and found large gains for absent or early matches, with regressions near the end, and marked the patch ready for committer #12.
- Heikki committed #9 as 9556aa01c6 with light comment and code cleanup, leaving the benchmark helper out of the production change and thanking John for review #13.
- The optimization was committed by the thread's end, while further reduction of pg_mblen call overhead remained optional follow-up work proposed by Heikki #13, with Bruce Momjian suggesting inlining just the UTF-8 case #14.