Skip to content

Instantly share code, notes, and snippets.

@qinwf
Created May 6, 2016 11:55
Show Gist options
  • Save qinwf/4f9dc53243ecfc84b850930661e8fe82 to your computer and use it in GitHub Desktop.
Save qinwf/4f9dc53243ecfc84b850930661e8fe82 to your computer and use it in GitHub Desktop.
profile
library(prof)
library(re2r)
library(stringi)
strs = rep(c("this is test", "this is test, and this is not test", "they are tests"),1000000)
start_profiler("sample.log")
invisible(re2_match_all(input = strs, pattern = "(this)( is)"))
#invisible(stri_match_all(strs, regex = "(this)( is)"))
stop_profiler()
# google-pprof --text /home/out/R/x86_64-pc-linux-gnu-library/3.2/re2r/libs/re2r.so sample.lo
# google-pprof --web /usr/lib/R/bin/exec/R sample.lo
# CPUPROFILE="sample.lo" R -f te.R
# b __strcat_sse2_unaligned
# google-pprof --web --focus=stri_match_all_regex /usr/bin/R sample.lo
#R -d "valgrind --tool=callgrind " --vanilla < te.R > res.log 2>&1
#google-pprof --web --focus=stri_match_all_regex /usr/local/lib/R/site-library/stringi/libs/stringi.so sample.lo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment