Commit b013f37
[Repo Assist] perf: compile regex instances to module-level singletons (#1162)
* perf: compile regex instances to module-level singletons
Five locations were creating a new uncompiled Regex on every call:
- PageContentList.mkPageContentMenu: new Regex per page rendered
- Formatting.fs (search index): Regex.Replace (static, uncompiled) per HTML page
- HtmlFormatting.formatAnchor: Regex.Matches per heading processed
- Menu.snakeCase: Regex.Replace (static, uncompiled) per menu item
- LlmsTxt (collapseBlankLines, normaliseTitle): two Regex.Replace per page entry
Each is now a module-level let binding with RegexOptions.Compiled, so the
pattern is compiled once at startup and reused for the lifetime of the
process.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>1 parent 4fb7fc0 commit b013f37
File tree
6 files changed
+27
-9
lines changed- src
- FSharp.Formatting.Common
- FSharp.Formatting.Literate
- FSharp.Formatting.Markdown
- fsdocs-tool
6 files changed
+27
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | | - | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
293 | | - | |
| 296 | + | |
294 | 297 | | |
295 | 298 | | |
296 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
1320 | 1327 | | |
1321 | 1328 | | |
1322 | 1329 | | |
| |||
1336 | 1343 | | |
1337 | 1344 | | |
1338 | 1345 | | |
1339 | | - | |
| 1346 | + | |
1340 | 1347 | | |
1341 | 1348 | | |
1342 | 1349 | | |
1343 | | - | |
| 1350 | + | |
1344 | 1351 | | |
1345 | 1352 | | |
1346 | 1353 | | |
| |||
0 commit comments