Skip to content

Instantly share code, notes, and snippets.

@headius
Created May 16, 2009 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/112518 to your computer and use it in GitHub Desktop.
Save headius/112518 to your computer and use it in GitHub Desktop.
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
~/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