Files
gitea-MIRROR/modules/references
Wei-Lun Li 7d1bc574f6 perf(markup): skip mention, email and commit regexps for text without "@" (#40471)
Post-processing runs the mention, email and cross-repo commit reference
regexps on every text node of rendered markdown, issue titles and commit
messages. All three patterns need an `@`, but none starts with a literal
the regexp engine can search for, so they took most of the
post-processing time even on text without one. Checking for `@` first
skips them with the same results.

Local Go benchmarks, i7-9700 on Windows 11, base and patched run
alternately 6 times, medians:

| | before | after |
|---|---|---|
| Markdown render of README + CONTRIBUTING + 3 docs (45 KB) | 16.1 ms |
11.4 ms |
| `PostProcessCommitMessageSubject` on the last 200 commit subjects of
this repo | 5.14 ms | 3.53 ms |
| `PostProcessIssueTitle` on the same 200 lines | 3.57 ms | 2.59 ms |

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 10:06:24 +00:00
..