Created
May 16, 2009 00:34
-
-
Save headius/112518 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
import java.lang.System | |
import java.io.PrintStream | |
macro :lprintln do | |
getstatic System, :out, PrintStream | |
dup_x2 | |
pop | |
invokevirtual PrintStream, :println, [void, long] | |
end | |
main do | |
invokestatic System, :nanoTime, [long] | |
lstore 1 | |
ldc 5000 | |
anewarray object | |
astore 3 | |
ldc 0 | |
istore 4 | |
label :top | |
bottom = label | |
iload 4 | |
ldc 1000 | |
if_icmpge bottom | |
aload 3 | |
iload 4 | |
aaload | |
pop | |
iinc 4, 1 | |
goto :top | |
bottom.set! | |
invokestatic System, :nanoTime, [long] | |
lload 1 | |
lsub | |
lprintln | |
returnvoid | |
end |
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
~/projects/jruby ➔ bite bench_array_each.bs | |
30000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment