Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created December 8, 2009 07:23
Show Gist options
  • Select an option

  • Save swannodette/251483 to your computer and use it in GitHub Desktop.

Select an option

Save swannodette/251483 to your computer and use it in GitHub Desktop.
; ~1400ms
(time
(dotimes [x 100000]
(let [ary (. #" " split "1 2 3 4 5 6 7 8 9 0")
a (aget ary 0)
b (aget ary 1)
c (aget ary 3)
d (aget ary 4)
e (aget ary 5)
f (aget ary 6)
g (aget ary 7)
h (aget ary 8)
i (aget ary 9)]
(.concat a b))))
; ~140ms
(time
(dotimes [x 100000]
(let [ary (. #" " split "1 2 3 4 5 6 7 8 9 0")
#^String a (aget ary 0)
#^String b (aget ary 1)
c (aget ary 3)
d (aget ary 4)
e (aget ary 5)
f (aget ary 6)
g (aget ary 7)
h (aget ary 8)
i (aget ary 9)]
(.concat a b))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment