Skip to content

Instantly share code, notes, and snippets.

@rauhs
Created November 27, 2016 08:44
Show Gist options
  • Save rauhs/622aaf526ff3c9e53e88190b7490df23 to your computer and use it in GitHub Desktop.
Save rauhs/622aaf526ff3c9e53e88190b7490df23 to your computer and use it in GitHub Desktop.
(defn startup-time
[]
(into []
(for [v [18 19]]
(let [jar (case v
18 "/tmp/clojure-1.8.0.jar"
19 "/tmp/clojure-1.9.0-alpha14.jar")
jvm-opts ["-Xverify:none"
"-XX:+TieredCompilation"
"-XX:TieredStopAtLevel=1"]
opts (concat ["time" "-f" "%e" "java"]
jvm-opts
["-cp" jar "clojure.main" "-e" "(println :hi)"])
{:keys [out err]}
(apply sh/sh opts)]
(assert (= out ":hi\n"))
[v (Double/parseDouble err)]))))
#_(startup-time)
#_(:err (sh/sh "time" "-f" "%e" "/tmp/lumo" "-e" "(println :hi)"))
;; => 0.22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment