mirror of
https://github.com/penpot/penpot.git
synced 2025-04-16 00:41:25 -05:00
⚡ Make matrix use native doubles.
Increases 300x the performance of multiply on the JVM platform.
This commit is contained in:
parent
e5885e83eb
commit
8479a6581d
2 changed files with 15 additions and 2 deletions
|
@ -14,7 +14,12 @@
|
|||
|
||||
;; --- Matrix Impl
|
||||
|
||||
(defrecord Matrix [a b c d e f]
|
||||
(defrecord Matrix [^double a
|
||||
^double b
|
||||
^double c
|
||||
^double d
|
||||
^double e
|
||||
^double f]
|
||||
Object
|
||||
(toString [_]
|
||||
(str "matrix(" a "," b "," c "," d "," e "," f ")")))
|
||||
|
|
|
@ -72,7 +72,15 @@
|
|||
(fn [v] (into {} v))))
|
||||
|
||||
(def matrix-read-handler
|
||||
(t/read-handler gmt/map->Matrix))
|
||||
(t/read-handler (fn [data]
|
||||
#?(:cljs (gmt/map->Matrix data)
|
||||
:clj (let [{:keys [a b c d e f]} data]
|
||||
(gmt/matrix (double a)
|
||||
(double b)
|
||||
(double c)
|
||||
(double d)
|
||||
(double e)
|
||||
(double f)))))))
|
||||
|
||||
;; --- ORDERED SET
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue