Displaying 1 result from an estimated 1 matches for "maketeststring".
2017 Jan 06
0
strsplit(perl=TRUE), gregexpr(perl=TRUE) very slow for long strings
...per match) the entire input
string to make sure it is valid UTF-8. If so, adding
PCRE_NO_UTF8_CHECK to the flags given to pcre_exec would solve the
problem. Perhaps R is already doing that in gsub(perl=TRUE).
Here is the test function:
regex.perf.test <- function(N=c(1e4, 2e4, 4e4, 8e4)) {
makeTestString <- function(n) paste(collapse="", rep("ab", n))
s <- lapply(N, makeTestString)
fns <- list(SubTRE=function(si) gsub("a", "", si, perl=FALSE),
SubPCRE=function(si) gsub("a", "", si, perl=TRUE),
StrS...