Cache symbols in compiler (w/ patch)
------------------------------------

                 Key: JRUBY-1494
                 URL: http://jira.codehaus.org/browse/JRUBY-1494
             Project: JRuby
          Issue Type: Improvement
            Reporter: Peter Brant
            Assignee: Thomas E Enebo
         Attachments: symbol_cache.patch

I saw a commit message from Bill that noted that caching symbols in compiled 
code would speed up symbol access a lot.  It seemed straightforward to do so 
I've done it.  It improves the performance of bench_symbol.rb by about a factor 
of three.

MRI:

{noformat}
C:\eclipseWorkspaceQT\jruby_trunk\test\bench>ruby bench_symbol.rb
Control: 100k loops accessing a local symbol 100 times
  0.080000   0.000000   0.080000 (  0.080000)
  0.070000   0.000000   0.070000 (  0.071000)
  0.070000   0.000000   0.070000 (  0.080000)
  0.080000   0.000000   0.080000 (  0.080000)
  0.070000   0.000000   0.070000 (  0.070000)
  0.081000   0.000000   0.081000 (  0.080000)
  0.070000   0.000000   0.070000 (  0.070000)
  0.080000   0.000000   0.080000 (  0.080000)
  0.070000   0.000000   0.070000 (  0.070000)
  0.070000   0.000000   0.070000 (  0.070000)
{noformat}

Interpreter:

{noformat}
C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby bench_symbol.rb
Control: 100k loops accessing a local symbol 100 times
  1.693000   0.000000   1.693000 (  1.693000)
  1.582000   0.000000   1.582000 (  1.582000)
  1.592000   0.000000   1.592000 (  1.592000)
  1.573000   0.000000   1.573000 (  1.573000)
  1.582000   0.000000   1.582000 (  1.582000)
  1.582000   0.000000   1.582000 (  1.582000)
  1.583000   0.000000   1.583000 (  1.583000)
  1.592000   0.000000   1.592000 (  1.592000)
  1.592000   0.000000   1.592000 (  1.592000)
  1.602000   0.000000   1.602000 (  1.602000)
{noformat}

Compiled before:

{noformat}
C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby -C bench_symbol.rb
Control: 100k loops accessing a local symbol 100 times
  0.711000   0.000000   0.711000 (  0.701000)
  0.451000   0.000000   0.451000 (  0.451000)
  0.411000   0.000000   0.411000 (  0.411000)
  0.420000   0.000000   0.420000 (  0.420000)
  0.421000   0.000000   0.421000 (  0.411000)
  0.410000   0.000000   0.410000 (  0.410000)
  0.411000   0.000000   0.411000 (  0.411000)
  0.411000   0.000000   0.411000 (  0.411000)
  0.420000   0.000000   0.420000 (  0.420000)
  0.411000   0.000000   0.411000 (  0.411000)
{noformat}

Compiled after:

{noformat}
C:\eclipseWorkspaceQT\jruby_trunk\test\bench>..\..\bin\jruby -C bench_symbol.rb
Control: 100k loops accessing a local symbol 100 times
  0.441000   0.000000   0.441000 (  0.441000)
  0.220000   0.000000   0.220000 (  0.220000)
  0.140000   0.000000   0.140000 (  0.140000)
  0.141000   0.000000   0.141000 (  0.141000)
  0.150000   0.000000   0.150000 (  0.150000)
  0.140000   0.000000   0.140000 (  0.140000)
  0.150000   0.000000   0.150000 (  0.150000)
  0.161000   0.000000   0.161000 (  0.161000)
  0.140000   0.000000   0.140000 (  0.140000)
  0.140000   0.000000   0.140000 (  0.140000)
{noformat}

-- 
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