sci: performance improvement
This commit is contained in:
parent
c71cfa637a
commit
bfa8b45e34
4 changed files with 22 additions and 4 deletions
8
deps.edn
8
deps.edn
|
|
@ -9,4 +9,10 @@
|
|||
org.clojure/data.csv {:mvn/version "0.1.4"},
|
||||
cheshire {:mvn/version "5.9.0"}}
|
||||
:aliases {:main
|
||||
{:main-opts ["-m" "babashka.main"]}}}
|
||||
{:main-opts ["-m" "babashka.main"]}
|
||||
:profile
|
||||
{:extra-deps
|
||||
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "0.4.0"}}
|
||||
:extra-paths ["test"]
|
||||
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
|
||||
:main-opts ["-m" "babashka.profile"]}}}
|
||||
|
|
|
|||
2
sci
2
sci
|
|
@ -1 +1 @@
|
|||
Subproject commit 381a158f72c1efbb8e48229bc67c7a109dffe7c0
|
||||
Subproject commit 6a63e4212567ad0304a88094eeb2970317d0bfd8
|
||||
|
|
@ -107,8 +107,8 @@
|
|||
(if (some opts-map [:file :socket-repl :expression :main])
|
||||
(assoc opts-map
|
||||
:command-line-args options)
|
||||
(let [opt (str/triml opt)
|
||||
c (.charAt opt 0)]
|
||||
(let [trimmed-opt (str/triml opt)
|
||||
c (.charAt trimmed-opt 0)]
|
||||
(case c
|
||||
(\( \{ \[ \* \@ \#)
|
||||
(assoc opts-map
|
||||
|
|
|
|||
12
test/babashka/profile.clj
Normal file
12
test/babashka/profile.clj
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(ns babashka.profile
|
||||
(:require [babashka.main :as main]))
|
||||
|
||||
(comment)
|
||||
|
||||
;; clojure -A:profile -e "(prn (loop [val 0 cnt 1000000] (if (pos? cnt) (recur (inc val) (dec cnt)) val)))"
|
||||
|
||||
#_(require '[clj-async-profiler.core :as prof])
|
||||
|
||||
(defn -main [& options]
|
||||
#_(prof/profile (apply main/main options))
|
||||
(shutdown-agents))
|
||||
Loading…
Reference in a new issue