@puzzler -server is the default mostly, but Leiningen overrides some of the important options that -server enables, as detailed by Alex.
@Lee the first 15 minutes of this talk by Tom Crayford has some useful info about performance and JVM options in it: https://skillsmatter.com/skillscasts/6148-opening-the-grimoire-some-things-about-clojure-performance For the record for my long-running workloads (which I suspect are _very_ similar to yours) I use: :jvm-opts ^:replace ["-server" ;;"-XX:+AggressiveOpts" ;;"-XX:+UseFastAccessorMethods" ;;"-XX:+UseCompressedOops" "-Xmx4g"] The commented out options are in there so I don't forget them (I learned some of them from Tom's talk), but I haven't found them to make any much difference for my jobs. Jony On Thursday, 14 May 2015 09:02:42 UTC+1, Amith George wrote: > > I wrote the following code to solve this challenge - > https://www.reddit.com/r/dailyprogrammer/comments/35s2ds/20150513_challenge_214_intermediate_pile_of_paper/ > . > > Code - > https://github.com/amithgeorge/reddit-dailyprogrammer-clojure/blob/56ce1dbb6a08e96150dc85934caecfeb68108a53/src/rdp/214_intermediate.clj > > I executed the -main function using `lein run 1`. > > Output > > ;; lein run 1 > > 0 12605919 > 1 3578145 > 2 15356894 > 3 19134293 > 4 2394558 > 5 15030409 > 6 6424953 > 7 14893444 > 8 1592254 > 9 1914025 > 10 7075106 > "Elapsed time: 501168.972435 msecs" > > The code originally used an immutable hashmap, but I lost patience waiting > for the computation to end. With mutable hashmap, it still takes around 8 > mins. > > I wrote a C# version of the above code - > https://gist.github.com/amithgeorge/766b8220f39d48221e58. It finishes > under 40secs. The C# exe was built under Release mode and executed directly > from the commandline. I expected the Clojure version to perform similarly. > > Any tips on what I am doing wrong? > > ----- > Explanation of the code - Create a vector of all paper sheets, such that > the sheet placed last is the first element of the vector and the last > element is the canvas. To compute the frequency of each visible color - for > each point in the canvas find the first sheet in the vector that covers the > point. Store/increment its count in the hashmap. I understand there might > be better more efficient ways to solve this, but currently I am interested > in why the Clojure versions is so slow vis-a-vis the C# version. > > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.