-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb.edn
44 lines (40 loc) · 2.18 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{:tasks
{:requires ([babashka.fs :as fs]
[babashka.cli :as cli]
[babashka.process :refer [shell]])
:init (do
(def opts (let [spec {:to {:default 10 :coerce :long}
:from {:default 1 :coerce :long}
:runs {:default 10 :coerce :long}
:index {:default 0 :coerce :long}
:warmup {:default 5 :coerce :long}
:object {:default "subset" :coerce :string}}]
(cli/parse-opts *command-line-args* {:spec spec})))
(def tag (.format (java.time.LocalDateTime/now)
(java.time.format.DateTimeFormatter/ofPattern "yyyy-MM-dd-HH-mm-ss")))
(defn ->processed [{:keys [object from to warmup runs]} operation args]
(shell (str "hyperfine "
"--warmup " warmup " "
"--shell none "
"--runs " runs " "
"--export-json ./data/" operation "-" object "-object-from-" from "-to-" to "__" tag ".json "
"--parameter-scan points " from " " to " "
"'./nulls --" operation "-" object "-object " args "'"))))
build (let [file-name "nulls"
file-jar (str file-name ".jar")
->paths (fn [] (fs/glob "./target/uberjar" "*-standalone.jar"))
run-native (str "native-image -jar "
(first (->paths))
" --no-server"
" --no-fallback"
" --features=clj_easy.graal_build_time.InitClojureClasses"
" "
file-name)]
(when (fs/exists? file-name)
(fs/delete file-name))
(shell "lein uberjar")
(shell run-native))
plot (let [{:keys [path]} (cli/parse-opts *command-line-args* {:spec {:path {:coerce :string}}})]
(shell (str "./script/plot.py" " " path)))
generate (->processed opts "generate" "\"{:n {points} :m 0}\"")
enumerate (->processed opts "enumerate" "\"{:n {points}}\"")}}