News for hackers. Stuff that matters.
Re:Analyzing networks of characters in 'Love Actually' by hadley on Friday December 25, 2015 @10:40PM (#10793169)
I find that surprising. Do you have benchmarks?
Re:Analyzing networks of characters in 'Love Actually' by minimaxir on Friday December 25, 2015 @11:10PM (#10793219)
Huh. Turns out I'm wrong. I ran benchmarking on a 1.8M row dataset of SF crime data w/ 100 replications.

Running grepl() via:

   benchmark(df %>% sample_frac() %>% filter(grepl("ARREST", Resolution)))
completed in 257.58 seconds.

Running str_detect() via:

   benchmark(df %>% sample_frac() %>% filter(str_detect(Resolution, "ARREST")))
completed in 248.917 seconds.

Overall, str_detect() is faster by 3%. The stringr packages has more surprises than I thought!