# NOT RUN {
requireNamespace("microbenchmark")
requireNamespace("stringr")
x <- random_string(25000)
microbenchmark::microbenchmark(
gsub(x = x, pattern = "A", replacement = "", fixed = TRUE, useBytes = TRUE),
gsub(x = x, pattern = "A", replacement = "", fixed = TRUE, useBytes = TRUE, perl = TRUE),
gsub(x = x, pattern = "A", replacement = ""),
stringr::str_replace_all(x, "A", "")
)
# }
Run the code above in your browser using DataLab