-
-
Save headius/cf8af0793c7ca3e04211589b4d279421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update path to persisted erb.ir: jruby -Xir.writing -rerb -e 1 | |
java_import org.jruby.util.ByteList, org.jruby.ir.persistence.IRReader, org.jruby.ir.persistence.IRReaderStream | |
manager = JRuby.runtime.ir_manager | |
filename = "/Users/headius/.ir/Users/headius/projects/jruby/lib/ruby/stdlib/erb.ir" | |
encoding = org.jcodings.specific.UTF8Encoding::INSTANCE | |
filename_bytes = ByteList.new(filename.to_java_bytes, encoding) | |
10.times do | |
t = Time.now | |
10.times do | |
stream = IRReaderStream.new(manager, File.open(filename).to_inputstream, filename_bytes) | |
IRReader.load(manager, stream) | |
end | |
puts Time.now - t | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment