From f0e1bc1d59994c6082929d655a842065256a5b62 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 28 Dec 2021 22:44:53 +0100 Subject: [PATCH] :fire: Remove unused code. --- common/src/app/common/geom/matrix.cljc | 13 --------- frontend/src/debug.cljs | 38 -------------------------- 2 files changed, 51 deletions(-) diff --git a/common/src/app/common/geom/matrix.cljc b/common/src/app/common/geom/matrix.cljc index d262e3d778..b8e5a761ea 100644 --- a/common/src/app/common/geom/matrix.cljc +++ b/common/src/app/common/geom/matrix.cljc @@ -62,19 +62,6 @@ ([m1 m2 & others] (reduce multiply (multiply m1 m2) others))) -(defn -old-multiply - ([{m1a :a m1b :b m1c :c m1d :d m1e :e m1f :f} - {m2a :a m2b :b m2c :c m2d :d m2e :e m2f :f}] - (Matrix. - (+ (* m1a m2a) (* m1c m2b)) - (+ (* m1b m2a) (* m1d m2b)) - (+ (* m1a m2c) (* m1c m2d)) - (+ (* m1b m2c) (* m1d m2d)) - (+ (* m1a m2e) (* m1c m2f) m1e) - (+ (* m1b m2e) (* m1d m2f) m1f))) - ([m1 m2 & others] - (reduce multiply (-old-multiply m1 m2) others))) - (defn add-translate "Given two TRANSLATE matrixes (only e and f have significative values), combine them. Quicker than multiplying them, for this diff --git a/frontend/src/debug.cljs b/frontend/src/debug.cljs index 460985b7dd..7df7c5f140 100644 --- a/frontend/src/debug.cljs +++ b/frontend/src/debug.cljs @@ -251,41 +251,3 @@ (not (debug-exclude-events (ptk/type s)))))) (rx/subs #(println "[stream]: " (ptk/repr-event %)))))) -#_(defn ^:export bench-matrix - [] - (let [iterations 1000000 - - good (gmt/multiply (gmt/matrix 1 2 3 4 5 6) - (gmt/matrix 1 2 3 4 5 6)) - - k1 (perf/start) - _ (dotimes [_ iterations] - (when-not (= good (gmt/-old-multiply (gmt/matrix 1 2 3 4 5 6) - (gmt/matrix 1 2 3 4 5 6))) - (throw "ERROR"))) - m1 (perf/measure k1) - - k2 (perf/start) - _ (dotimes [_ iterations] - (when-not (= good (gmt/multiply (gmt/matrix 1 2 3 4 5 6) - (gmt/matrix 1 2 3 4 5 6))) - (throw "ERROR"))) - m2 (perf/measure k2) - - k3 (perf/start) - _ (dotimes [_ iterations] - (let [res (.concatenate (AffineTransform. 1 2 3 4 5 6) - (AffineTransform. 1 2 3 4 5 6)) - res (gmt/matrix (.-m00_ res) (.-m10_ res) (.-m01_ res) (.-m11_ res) (.-m02_ res) (.-m12_ res))] - - (when-not (= good res) - (throw "ERROR")))) - m3 (perf/measure k3) - ] - - (println "Clojure matrix. Total: " m1 " (" (/ m1 iterations) ")") - (println "Clojure matrix (NEW). Total: " m2 " (" (/ m2 iterations) ")") - (println "Affine transform (with new). Total: " m3 " (" (/ m3 iterations) ")"))) - - -