Skip to content

Commit a413cad

Browse files
Replaced SSGROW with SSCHECK inside regcppush
Observed is huge slow-down on Win32 machines with many leveled nested recursive patterns. Bottleneck identified to be SSGROW reallocations inside regcppush. Replacing with SSCHECK yields huge performance gains (to the extened for it to be called a "fix") on said platform.
1 parent 5b3c3cc commit a413cad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

regexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ S_regcppush(pTHX_ const regexp *rex, I32 parenfloor, U32 maxopenparen _pDEPTH)
261261
);
262262
);
263263

264-
SSGROW(total_elems + REGCP_FRAME_ELEMS);
264+
SSCHECK(total_elems + REGCP_FRAME_ELEMS);
265265

266266
/* memcpy the offs inside the stack - it's faster than for loop */
267267
memcpy(&PL_savestack[PL_savestack_ix], rex->offs + parenfloor + 1, paren_bytes_to_push);

0 commit comments

Comments
 (0)