Nov 07

Interesting phenomenon; for finding whenever some string occurs inside other string, String#match is 5 (!) times faster than String#include? for long strings (50k), and 2 times slower for short strings (tens of bytes).
The slowness can be explained by the time it takes to compile the regexp.
But how can it be so slow for long strings? Going to ask this in ruby.core.

 

March 2010
S M T W T F S
« Feb    
 123456
78910111213
14151617181920
21222324252627
28293031  

Pages