Skip to content

Instantly share code, notes, and snippets.

@tak1n
Created May 23, 2015 17:16
Show Gist options
  • Save tak1n/5b96dfe96804f900047c to your computer and use it in GitHub Desktop.
Save tak1n/5b96dfe96804f900047c to your computer and use it in GitHub Desktop.
Rubinius IO
# require 'rubinius/profiler' if RUBY_ENGINE == 'rbx'
large_file = File.join(File.dirname(__FILE__), 'large.txt')
large_handle = File.open(large_file, 'r')
# if RUBY_ENGINE == 'rbx'
# profiler = Rubinius::Profiler::Instrumenter.new
# profiler.start
# end
large_handle.each_byte {}
large_handle.rewind
# if RUBY_ENGINE == 'rbx'
# profiler.stop
# profiler.show
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment