This file contains hidden or 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
BEFORE | |
user system total real | |
1m x10 yield 1 to { } 2.648000 0.000000 2.648000 ( 2.647000) | |
1m x10 yield to { } 2.539000 0.000000 2.539000 ( 2.539000) | |
1m x10 yield 1 to {|j| j} 3.168000 0.000000 3.168000 ( 3.168000) | |
1m x10 yield 1,2 to {|j,k| k} 3.643000 0.000000 3.643000 ( 3.643000) | |
1m x10 yield 1,2,3 to {|j,k,l| k} 4.062000 0.000000 4.062000 ( 4.063000) | |
1m x10 yield to {|j,k,l| k} 3.776000 0.000000 3.776000 ( 3.776000) | |
1m x10 yield 1,2,3 to {|*j| j} 4.730000 0.000000 4.730000 ( 4.730000) | |
1m x10 yield to {1} 2.955000 0.000000 2.955000 ( 2.955000) |
This file contains hidden or 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
~/projects/jruby ➔ gem install rails | |
fetching: http://gemcutter.org/quick/Marshal.4.8/rails-2.3.5.gemspec | |
fetching: http://gems.rubyforge.org/quick/Marshal.4.8/rails-2.3.5.gemspec | |
fetching: http://gemcutter.org/quick/Marshal.4.8/rake-0.8.7.gemspec | |
fetching: http://gems.rubyforge.org/quick/Marshal.4.8/rake-0.8.7.gemspec | |
fetching: http://gemcutter.org/quick/Marshal.4.8/activesupport-2.3.5.gemspec | |
fetching: http://gems.rubyforge.org/quick/Marshal.4.8/activesupport-2.3.5.gemspec | |
fetching: http://gemcutter.org/quick/Marshal.4.8/activerecord-2.3.5.gemspec | |
fetching: http://gems.rubyforge.org/quick/Marshal.4.8/activerecord-2.3.5.gemspec | |
fetching: http://gemcutter.org/quick/Marshal.4.8/actionpack-2.3.5.gemspec |
This file contains hidden or 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
~/projects/jruby/tmp ➔ cat blah.rb | |
class Foo | |
def method(a, b) | |
end | |
class Bar | |
def yummy(a, *b) | |
end | |
end | |
end |
This file contains hidden or 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
public int hashCode() { | |
int h = hash; | |
if (h == 0) { | |
int off = offset; | |
char val[] = value; | |
int len = count; | |
for (int i = 0; i < len; i++) { | |
h = 31*h + val[off++]; | |
} |
This file contains hidden or 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
~/tmp/tmp2 ➔ ls -l | |
total 80 | |
-rw-r--r-- 1 headius staff 1088 Dec 21 12:21 Marshal.4.8 | |
-rw-r--r-- 1 headius staff 604 Dec 21 12:21 Marshal.4.8.Z | |
drwxr-xr-x 4 headius staff 136 Dec 21 12:21 gems | |
-rw-r--r-- 1 headius staff 79 Dec 21 12:21 latest_specs.4.8 | |
-rw-r--r-- 1 headius staff 88 Dec 21 12:21 latest_specs.4.8.gz | |
-rw-r--r-- 1 headius staff 4 Dec 21 12:21 prerelease_specs.4.8 | |
-rw-r--r-- 1 headius staff 24 Dec 21 12:21 prerelease_specs.4.8.gz | |
drwxr-xr-x 9 headius staff 306 Dec 21 12:21 quick |
This file contains hidden or 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
~/projects/jruby ➔ jruby -J-Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n object_walker_test.rb | |
Listening for transport dt_socket at address: 12345 | |
found object: I am Foo #0 | |
found object: I am Foo #1 | |
found object: I am Foo #2 | |
found object: I am Foo #3 | |
found object: I am Foo #4 | |
found object: I am Foo #5 | |
found object: I am Foo #6 | |
found object: I am Foo #7 |
This file contains hidden or 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
~/projects/jruby ➔ jruby -J-Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n -S jirb | |
Listening for transport dt_socket at address: 12345 | |
irb(main):001:0> require 'java' | |
=> true | |
irb(main):002:0> vmm = com.sun.jdi.Bootstrap.virtual_machine_manager | |
=> com.sun.tools.jdi.VirtualMachineManagerImpl@67fc9fee | |
irb(main):003:0> vmm.attaching_connectors | |
=> [com.sun.jdi.SocketAttach (defaults: timeout=, hostname=charles-nutters-macbook-pro.local, port=), com.sun.jdi.ProcessAttach (defaults: pid=, timeout=)] | |
irb(main):004:0> sock_attach = vmm.attaching_connectors[0] | |
=> com.sun.jdi.SocketAttach (defaults: timeout=, hostname=charles-nutters-macbook-pro.local, port=) |
This file contains hidden or 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
~/projects/jruby ➔ jruby -J-Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n -S jirb | |
Listening for transport dt_socket at address: 12345 | |
irb(main):001:0> require 'java' | |
=> true | |
irb(main):002:0> vmm = com.sun.jdi.Bootstrap.virtual_machine_manager | |
=> com.sun.tools.jdi.VirtualMachineManagerImpl@67fc9fee | |
irb(main):003:0> vmm.attaching_connectors | |
=> [com.sun.jdi.SocketAttach (defaults: timeout=, hostname=charles-nutters-macbook-pro.local, port=), com.sun.jdi.ProcessAttach (defaults: pid=, timeout=)] | |
irb(main):004:0> sock_attach = vmm.attaching_connectors[0] | |
=> com.sun.jdi.SocketAttach (defaults: timeout=, hostname=charles-nutters-macbook-pro.local, port=) |
This file contains hidden or 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
~/projects/jruby ➔ jirb | |
irb(main):001:0> require 'java' | |
=> true | |
irb(main):002:0> import com.sun.tools.attach.VirtualMachine | |
=> Java::ComSunToolsAttach::VirtualMachine | |
irb(main):003:0> vm = VirtualMachine.attach($$.to_s) | |
=> sun.tools.attach.MacosxAttachProvider@47875da7: 3294 | |
irb(main):004:0> histo = vm.heap_histo([].to_java).to_io | |
=> #<IO:0x32b95f72> | |
irb(main):005:0> histo.lines.first(25).each {|line| puts line}; nil |
This file contains hidden or 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
def setup | |
if WINDOWS | |
@block_dev = "NUL" | |
@other_dev = "C:\\" | |
else | |
if File.exists?("/dev/fd0") | |
@block_dev = "/dev/fd0" | |
elsif File.exists?("/dev/diskette") | |
@block_dev = "/dev/diskette" | |
elsif File.exists?("/dev/cdrom") |