forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5227d99
committed
Rethink regexp engine's backref-related compilation state.
I had committer's remorse almost immediately after pushingcb76fbd,upon finding that removing capturing subexpressions' subREs from thedata structure broke my proposed patch for REG_NOSUB optimization.Revert that data structure change. Instead, address the concernabout not changing capturing subREs' endpoints by not changing theendpoints. We don't need to, because the point of that bit was justto ensure that the atom has endpoints distinct from the outer statepair that we're stringing the branch between. We already madesuitable states in the parenthesized-subexpression case, so theadditional ones were just useless overhead. This seems moreunderstandable than Spencer's original coding, and it ought to bea shade faster too by saving a few state creations and arc changes.(I actually see a couple percent improvement on Jacobson's webcorpus, though that's barely above the noise floor so I wouldn'tput much stock in that result.)Also, fix the logic added byea1268f to ensure that the subRErecorded in v->subs[subno] is exactly the one with capno == subno.Spencer's original coding recorded the child subRE of the capturenode, which is okay so far as having the right endpoint states isconcerned, but as ofcb76fbd the capturing subRE itself alwayshas those endpoints too. I think the inconsistency is confusingfor the REG_NOSUB optimization.As before, backpatch to v14.Discussion:https://postgr.es/m/0203588E-E609-43AF-9F4F-902854231EE7@enterprisedb.com1 parent5e6ad63 commit5227d99
1 file changed
+47
-37
lines changedLines changed: 47 additions & 37 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 | 236 |
| |
244 | 237 |
| |
245 | 238 |
| |
| |||
252 | 245 |
| |
253 | 246 |
| |
254 | 247 |
| |
255 |
| - | |
256 |
| - | |
257 |
| - | |
258 |
| - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
259 | 252 |
| |
260 | 253 |
| |
261 | 254 |
| |
| |||
375 | 368 |
| |
376 | 369 |
| |
377 | 370 |
| |
378 |
| - | |
| 371 | + | |
379 | 372 |
| |
380 | 373 |
| |
381 | 374 |
| |
| |||
511 | 504 |
| |
512 | 505 |
| |
513 | 506 |
| |
514 |
| - | |
| 507 | + | |
515 | 508 |
| |
516 | 509 |
| |
517 | 510 |
| |
518 | 511 |
| |
519 | 512 |
| |
520 |
| - | |
| 513 | + | |
521 | 514 |
| |
522 | 515 |
| |
523 | 516 |
| |
524 | 517 |
| |
525 | 518 |
| |
526 | 519 |
| |
527 | 520 |
| |
528 |
| - | |
| 521 | + | |
529 | 522 |
| |
530 | 523 |
| |
531 |
| - | |
| 524 | + | |
532 | 525 |
| |
533 | 526 |
| |
534 |
| - | |
| 527 | + | |
535 | 528 |
| |
536 | 529 |
| |
537 | 530 |
| |
538 | 531 |
| |
539 | 532 |
| |
540 | 533 |
| |
541 | 534 |
| |
542 |
| - | |
| 535 | + | |
543 | 536 |
| |
544 | 537 |
| |
545 | 538 |
| |
| |||
988 | 981 |
| |
989 | 982 |
| |
990 | 983 |
| |
| 984 | + | |
991 | 985 |
| |
992 | 986 |
| |
993 | 987 |
| |
| |||
997 | 991 |
| |
998 | 992 |
| |
999 | 993 |
| |
1000 |
| - | |
1001 |
| - | |
1002 |
| - | |
1003 |
| - | |
1004 | 994 |
| |
1005 | 995 |
| |
1006 | 996 |
| |
| |||
1016 | 1006 |
| |
1017 | 1007 |
| |
1018 | 1008 |
| |
| 1009 | + | |
| 1010 | + | |
1019 | 1011 |
| |
1020 | 1012 |
| |
1021 | 1013 |
| |
1022 | 1014 |
| |
1023 | 1015 |
| |
1024 | 1016 |
| |
1025 |
| - | |
| 1017 | + | |
1026 | 1018 |
| |
1027 | 1019 |
| |
1028 | 1020 |
| |
| |||
1097 | 1089 |
| |
1098 | 1090 |
| |
1099 | 1091 |
| |
1100 |
| - | |
| 1092 | + | |
1101 | 1093 |
| |
1102 | 1094 |
| |
1103 | 1095 |
| |
| |||
1130 | 1122 |
| |
1131 | 1123 |
| |
1132 | 1124 |
| |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1133 | 1150 |
| |
1134 | 1151 |
| |
1135 | 1152 |
| |
1136 | 1153 |
| |
1137 | 1154 |
| |
1138 |
| - | |
| 1155 | + | |
1139 | 1156 |
| |
1140 |
| - | |
| 1157 | + | |
| 1158 | + | |
1141 | 1159 |
| |
1142 | 1160 |
| |
1143 | 1161 |
| |
1144 |
| - | |
| 1162 | + | |
1145 | 1163 |
| |
1146 | 1164 |
| |
1147 | 1165 |
| |
1148 | 1166 |
| |
1149 |
| - | |
1150 |
| - | |
1151 |
| - | |
1152 |
| - | |
1153 |
| - | |
1154 |
| - | |
1155 |
| - | |
1156 |
| - | |
1157 | 1167 |
| |
1158 | 1168 |
| |
1159 | 1169 |
| |
| |||
1190 | 1200 |
| |
1191 | 1201 |
| |
1192 | 1202 |
| |
1193 |
| - | |
| 1203 | + | |
1194 | 1204 |
| |
1195 | 1205 |
| |
1196 | 1206 |
| |
1197 | 1207 |
| |
1198 | 1208 |
| |
1199 | 1209 |
| |
1200 |
| - | |
| 1210 | + | |
1201 | 1211 |
| |
1202 | 1212 |
| |
1203 | 1213 |
| |
|
0 commit comments
Comments
(0)