To give you a bit of an explanation - I'd like to use clojure/clojurescript for scripting... I was reading the: http://blog.brunobonacci.com/2017/08/10/lumo-vs-planck-vs-clojure-vs-pixie/ and got curious how does the 1.9.0 behave when talking about startup times. (Oh BTW notice that lumo and planck compute wrong results, how lovely :)
> If it is all extra startup time, that could be due to loading spec and > def'ing extra Clojure 1.9 Vars during initialization. It really looks like it is the startup time. Unfortunately: > start with "java -cp <classpath> ..." to get an apples to apples comparison makes not much of a difference. Anyway, thank you for the (correctly computing :-) 1.9.0! Bost time java -jar /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 10)))' #'user/Σ 50000005000000 1.47user 0.07system 0:00.79elapsed 194%CPU (0avgtext+0avgdata 197744maxresident)k 0inputs+64outputs (0major+45783minor)pagefaults 0swaps time java -cp /home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar clojure.main -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 10)))' #'user/Σ 50000005000000 2.30user 0.04system 0:00.95elapsed 246%CPU (0avgtext+0avgdata 213724maxresident)k 0inputs+64outputs (0major+49720minor)pagefaults 0swaps time java -jar /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 100)))' #'user/Σ 5000000050000000 2.10user 0.13system 0:01.49elapsed 150%CPU (0avgtext+0avgdata 730068maxresident)k 0inputs+64outputs (0major+178898minor)pagefaults 0swaps time java -cp /home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar clojure.main -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 100)))' #'user/Σ 5000000050000000 3.10user 0.25system 0:01.90elapsed 176%CPU (0avgtext+0avgdata 740780maxresident)k 0inputs+64outputs (0major+182178minor)pagefaults 0swaps time java -jar /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 1000)))' #'user/Σ 500000000500000000 9.31user 0.24system 0:08.64elapsed 110%CPU (0avgtext+0avgdata 743596maxresident)k 0inputs+64outputs (0major+183306minor)pagefaults 0swaps time java -cp /home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar clojure.main -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 1000)))' #'user/Σ 500000000500000000 9.72user 0.25system 0:08.51elapsed 117%CPU (0avgtext+0avgdata 749604maxresident)k 0inputs+64outputs (0major+185270minor)pagefaults 0swaps 2017-12-09 6:23 GMT+01:00 Alex Miller <a...@puredanger.com>: > > On Friday, December 8, 2017 at 7:54:23 PM UTC-6, Bost wrote: >> >> Hi, first of all: thanks for the 1.9.0! >> And now issue: it looks like the 1.9.0 is slower than 1.8.0. Is there >> any --turbo switch to flip? > > > I think to be a better comparison, I would do clj -Spath to grab your > classpath and in both cases start with "java -cp <classpath> ..." to get an > apples to apples comparison. The clj script is fast compared to Clojure > startup but it is checking and comparing files time for multiple files to > determine whether it can use the cached classpath. > > Second I don't think you're doing enough work or enough timings here to > necessarily get past the JVM hotspot compilation overhead and see times that > are worth comparing. If you want to benchmark the time for the reduce, I > would add criterium and exclude the startup time. My expectation would be > that the times are pretty similar as little has changed that should affect > what you're doing here. > > Startup time through clojure.main (which you're doing in both cases) does > currently have a side effect of loading spec and the core specs which adds > about 0.1-0.2 s. Startup time on AOT'ed code NOT going through clojure.main > can usually avoid these. > > >> >> >> Bost >> >> >> time java -jar >> /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar >> -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 >> 1000)))' >> #'user/Σ >> 500000500000 >> 1.31user 0.04system 0:00.65elapsed 205%CPU (0avgtext+0avgdata >> 101872maxresident)k >> 0inputs+64outputs (0major+21822minor)pagefaults 0swaps >> >> time clj -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* >> 1000 1000)))' >> #'user/Σ >> 500000500000 >> 2.03user 0.05system 0:00.92elapsed 226%CPU (0avgtext+0avgdata >> 108284maxresident)k >> 0inputs+64outputs (0major+25522minor)pagefaults 0swaps >> >> >> >> time java -jar >> /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar >> -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 >> 10)))' >> #'user/Σ >> 50000005000000 >> 1.72user 0.08system 0:00.88elapsed 204%CPU (0avgtext+0avgdata >> 199204maxresident)k >> 0inputs+64outputs (0major+46108minor)pagefaults 0swaps >> >> time clj -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* >> 1000 1000 10)))' >> #'user/Σ >> 50000005000000 >> 2.63user 0.09system 0:01.27elapsed 214%CPU (0avgtext+0avgdata >> 210056maxresident)k >> 0inputs+64outputs (0major+50405minor)pagefaults 0swaps >> >> >> >> time java -jar >> /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar >> -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 >> 100)))' >> #'user/Σ >> 5000000050000000 >> 2.17user 0.23system 0:01.59elapsed 151%CPU (0avgtext+0avgdata >> 729756maxresident)k >> 0inputs+64outputs (0major+178749minor)pagefaults 0swaps >> >> time clj -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* >> 1000 1000 100)))' >> #'user/Σ >> 5000000050000000 >> 2.95user 0.28system 0:01.87elapsed 172%CPU (0avgtext+0avgdata >> 739368maxresident)k >> 0inputs+64outputs (0major+182736minor)pagefaults 0swaps >> >> >> >> time java -jar >> /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar >> -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* 1000 1000 >> 1000)))' >> #'user/Σ >> 500000000500000000 >> 9.34user 0.27system 0:08.75elapsed 109%CPU (0avgtext+0avgdata >> 744520maxresident)k >> 0inputs+64outputs (0major+183953minor)pagefaults 0swaps >> >> time clj -e '(defn Σ [n] (reduce + (range (inc n)))) (println (Σ (* >> 1000 1000 1000)))' >> #'user/Σ >> 500000000500000000 >> 10.52user 0.25system 0:09.29elapsed 115%CPU (0avgtext+0avgdata >> 752244maxresident)k >> 0inputs+104outputs (0major+189351minor)pagefaults 0swaps >> >> >> 2017-12-08 23:17 GMT+01:00 Jose Figueroa Martinez <col...@gmail.com>: >> > Excelent news! Thank you all for your effort. >> > >> > It feels like christmas but earlier :-D >> > >> > "We wish you a merry christmas and a happy new Clojure!" >> > >> > José FM >> > >> > >> > El viernes, 8 de diciembre de 2017, 13:35:39 (UTC-6), Alex Miller >> > escribió: >> >> >> >> Clojure 1.9 is now available! >> >> >> >> >> >> Clojure 1.9 introduces two major new features: integration with spec >> >> and >> >> command line tools. >> >> >> >> >> >> spec (rationale, guide) is a library for describing the structure of >> >> data >> >> and functions with support for: >> >> >> >> Validation >> >> Error reporting >> >> Destructuring >> >> Instrumentation >> >> Test-data generation >> >> Generative test generation >> >> Documentation >> >> >> >> Clojure integrates spec via two new libraries (still in alpha): >> >> >> >> spec.alpha - spec implementation >> >> core.specs.alpha - specifications for Clojure itself >> >> >> >> This modularization facilitates refinement of spec separate from the >> >> Clojure release cycle. >> >> >> >> The command line tools (guide, reference) provide: >> >> >> >> Quick and easy install >> >> Clojure REPL and runner >> >> Use of Maven and local dependencies >> >> A functional API for classpath management (tools.deps.alpha) >> >> >> >> The installer is available for Mac developers in brew, for Linux users >> >> in >> >> a script, and for more platforms in the future. >> >> >> >> For more information, see the complete list of all changes in Clojure >> >> 1.9 >> >> for more details. >> >> >> >> >> >> Contributors >> >> >> >> >> >> Thanks to all of the community members who contributed to Clojure 1.9 >> >> (first time contributors in bold): >> >> >> >> Adam Clements >> >> Andy Fingerhut >> >> Brandon Bloom >> >> Cameron Desautels >> >> Chad Taylor >> >> Chris Houser >> >> David Bürgin >> >> Eli Lindsey >> >> Gerrit Jansen Van Vuuren >> >> Ghadi Shayban >> >> Greg Leppert >> >> Jason Whitlark >> >> Johan Mena >> >> Jozef Wagner >> >> Lee Yen-Chin >> >> Matthew Boston >> >> Michael Blume >> >> Michał Marczyk >> >> Nicola Mometto >> >> Ruslan Al-Fakikh >> >> Steffen Dienst >> >> Steve Miner >> >> Yegor Timoshenko >> >> Zhuang XiaoDan >> > >> > -- >> > 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. >> > -- > 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. -- 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.