>
> union does an implicit distinct operation, as it returns a set.  I
> didn't think Clojure had multisets, unless we've had another Rich's  
> Time
> Machine moment :)

Nope, it doesn't have multisets ... I somehow read that as "apply  
concat" rather than "apply union" ... maybe I need some more sleep :)

> I generated 10 sets of 100 random integers between 0-200. Then I timed
> 3000 iterations applied to 1 thru 10 sets, on a -server VM. I warmed  
> up
> the JIT on each version a couple of times.
>
> First version / second version:
>
> "Elapsed time: 462.881526 msecs"  "Elapsed time: 1.445784 msecs"
> "Elapsed time: 901.305403 msecs"  "Elapsed time: 357.005849 msecs"
> "Elapsed time: 1334.729903 msecs" "Elapsed time: 783.21756 msecs"
> "Elapsed time: 1746.563041 msecs" "Elapsed time: 1165.418231 msecs"
> "Elapsed time: 2264.295812 msecs" "Elapsed time: 1549.46746 msecs"
> "Elapsed time: 2569.731838 msecs" "Elapsed time: 1956.67962 msecs"
> "Elapsed time: 2854.096121 msecs" "Elapsed time: 2349.644787 msecs"
> "Elapsed time: 3278.285648 msecs" "Elapsed time: 2768.575964 msecs"
> "Elapsed time: 3529.430695 msecs" "Elapsed time: 3136.699357 msecs"
> "Elapsed time: 3854.478292 msecs" "Elapsed time: 3514.263823 msecs"
>
> It seems they're both linear complexity but the second is faster by a
> noticeable constant. Fascinating!

Looks good to me...

-Jason


--~--~---------~--~----~------------~-------~--~----~
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
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