diff --git a/perf-test/clojurewerkz/triennium/perf_test_1.clj b/perf-test/clojurewerkz/triennium/perf_test_1.clj new file mode 100644 index 0000000..3d72846 --- /dev/null +++ b/perf-test/clojurewerkz/triennium/perf_test_1.clj @@ -0,0 +1,17 @@ +(require '[clojurewerkz.triennium.mqtt :as tr]) +(require '[criterium.core :as cc]) + +(def trie + (-> (tr/make-trie) + (tr/insert "a/+/1" :a+1) + (tr/insert "a/+/2" :a+2) + ;(tr/insert "a/+/#" :a+#) + (tr/insert "a/b/1" :ab1))) + +(cc/quick-bench + (dotimes [_ 1000] + (tr/matching-vals trie "a/x/1"))) + +(cc/quick-bench + (dotimes [_ 1000] + (tr/matching-vals trie "a/thisisatest/more/data"))) diff --git a/project.clj b/project.clj index 0636867..c470d90 100644 --- a/project.clj +++ b/project.clj @@ -10,8 +10,14 @@ :plugins [[codox "0.10.7"]] :codox {:sources ["src/clojure"] :output-dir "doc/api"} - :dependencies [[org.clojure/test.check "1.1.0"]]}} - :aliases {"all" ["with-profile" "dev:dev,1.8:dev,1.9:dev,master"]} + :dependencies [[org.clojure/test.check "1.1.0"] + [criterium "0.4.6"]]} + :perf {:jvm-opts ^:replace ["-server"] + "-Xmx4096m" + "-Dclojure.compiler.direct-linking=true" + :test-paths ["perf-test/clj"]}} + :aliases {"all" ["with-profile" "dev:dev,1.8:dev,1.9:dev,master"] + "perf" ["with-profile" "default,dev,perf"]} :repositories {"sonatype" {:url "http://oss.sonatype.org/content/repositories/releases" :snapshots false :releases {:checksum :fail}}