Hi there,

I made a highly unscientific test of performance of regexps in Ruby
compared to JRuby.
The attached script is what I used to test this. The output is as
follows for 100 000 repetitions of the same regexp applying:
D:\Project\jruby>ruby testRegexpPerformance.rb
Time1 0.201 for sum 150000
Time2 0.22 for sum 150000

D:\Project\jruby>bin\jruby testRegexpPerformance.rb
Time1 5.698 for sum 150000
Time2 3.986 for sum 150000

This seems fairly good, actually, we're only an order of magnitude
slower, which is not so bad if you think about all the stuff that's
going on. The difference between Time1 and Time2 is what happens if I
save the regexp in a variable before the loop, or not. As you can see,
we could save pretty much performance here.

Regards
 Ola Bini

Attachment: testRegexpPerformance.rb
Description: Binary data

Reply via email to