If I run this code:

 (def ibounds 1000000)

  (let [arlist (new java.util.ArrayList ibounds)]
    (dotimes [i ibounds]
      (.add arlist 0))
    (time (dotimes [x 100]
            (dotimes [i ibounds]
              (.set arlist i 1)))))

  (let [arlist (make-array Integer/TYPE ibounds)]
    (time (dotimes [x 100]
            (dotimes [i ibounds]
              (aset arlist i 1)))))

The output is:

"Elapsed time: 1207.023797 msecs"
"Elapsed time: 11569.701736 msecs"
nil

Is this normal behavior or am I doing something wrong?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to