Skip to content

Instantly share code, notes, and snippets.

@realjenius
Created October 20, 2009 02:51
Show Gist options
  • Select an option

  • Save realjenius/213949 to your computer and use it in GitHub Desktop.

Select an option

Save realjenius/213949 to your computer and use it in GitHub Desktop.
With JRUBY-1.5.0-DEV, no patches:
rj-lorimers-macbook-pro:bench rjlorimer$ ../bin/jruby --server bench_io_foreach.rb
user system total real
IO.foreach(file) 15.171000 0.000000 15.171000 ( 15.107000)
user system total real
IO.foreach(file) 13.667000 0.000000 13.667000 ( 13.667000)
user system total real
IO.foreach(file) 13.144000 0.000000 13.144000 ( 13.144000)
user system total real
IO.foreach(file) 14.110000 0.000000 14.110000 ( 14.110000)
user system total real
IO.foreach(file) 14.630000 0.000000 14.630000 ( 14.630000)
With the latest patch for JRUBY-2810 and incrementLineno
rj-lorimers-macbook-pro:bench rjlorimer$ ../bin/jruby --server bench_io_foreach.rb
user system total real
IO.foreach(file) 12.031000 0.000000 12.031000 ( 11.957000)
user system total real
IO.foreach(file) 11.804000 0.000000 11.804000 ( 11.803000)
user system total real
IO.foreach(file) 11.703000 0.000000 11.703000 ( 11.703000)
user system total real
IO.foreach(file) 11.709000 0.000000 11.709000 ( 11.709000)
user system total real
IO.foreach(file) 11.829000 0.000000 11.829000 ( 11.829000)
With the latest patch for JRUBY-2810 and incrementLineno removed:
rj-lorimers-macbook-pro:bench rjlorimer$ ../bin/jruby --server bench_io_foreach.rb
user system total real
IO.foreach(file) 9.069000 0.000000 9.069000 ( 9.033000)
user system total real
IO.foreach(file) 8.344000 0.000000 8.344000 ( 8.344000)
user system total real
IO.foreach(file) 8.346000 0.000000 8.346000 ( 8.346000)
user system total real
IO.foreach(file) 8.422000 0.000000 8.422000 ( 8.422000)
user system total real
IO.foreach(file) 8.390000 0.000000 8.390000 ( 8.390000)
-- The 'bench_io_foreach_wide.rb' benchmark has no discernible difference removing incrementLineNo - it doesn't access the variable enough to make a difference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment