Kurt Stephens

Nerd Up!

Recent comments

Syndicate

Syndicate content

Browse archives

« November 2008 »
Mo Tu We Th Fr Sa Su
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15
17 18 19 20 21 22 23
24 25 26 27 28 29 30

archives

Ruby: Performance of Symbol Construction

Kurt on Sun, 2008-11-23 03:54.

Measurements of Symbol Constructor Expressions.

n=10_000_000

ruby 1.8.6 (2008-08-08 patchlevel 286) [i686-linux]:

> /cnu/bin/ruby symbol_benchmark.rb
                               user     system      total        real
Null Test                  0.740000   0.000000   0.740000 (  0.742914)
'foo_bar'                  1.670000   0.000000   1.670000 (  1.661374)
"foo_bar"                  1.620000   0.000000   1.620000 (  1.625221)
:foo_bar                   0.890000   0.000000   0.890000 (  0.886903)
:'foo_bar'                 0.880000   0.000000   0.880000 (  0.878555)
<br class="clear" />