default regexp is quite slow compared to mri
--------------------------------------------

                 Key: JRUBY-3696
                 URL: http://jira.codehaus.org/browse/JRUBY-3696
             Project: JRuby
          Issue Type: Improvement
          Components: Performance
    Affects Versions: JRuby 1.2
         Environment: 2.6.26-1-amd64 debian lenny
AMD Athlon(tm) 64 X2 Dual Core Processor 5600+
4Gb RAM
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [amd64-java]
ava version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)

            Reporter: ochronus


For a very simple regexp benchmark script:

require 'benchmark'

rexp = Regexp.new('[a-z]{1,3}[0-9]{2}')
str = 'ab22'


puts Benchmark.measure {
    100000.times {
        str.match(rexp)      
    }
}

---- MRI ----
  0.190000   0.020000   0.210000 (  0.199448)

---- JRUBY (/opt/jruby-1.2.0/bin/jruby --1.9 --server regexp_benchmark.rb) ----
 0.725000   0.000000   0.725000 (  0.662000)
---- JRUBY (/opt/jruby-1.2.0/bin/jruby  regexp_benchmark.rb) ----
0.788000   0.000000   0.788000 (  0.706000)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to