performance increases

memoize construction of ranges, and use transient/mutable
Java collections for internal collection state
This commit is contained in:
2026-01-13 21:01:46 -06:00
parent df24a84908
commit 9ffa5d1b97
3 changed files with 42 additions and 37 deletions

View File

@@ -31,10 +31,12 @@
(toString [_this]
(str start ".." end)))
(defn int-range-inclusive [start end]
(defn- int-range-inclusive* [start end]
(assert (<= start end) (str "start : " start "; end: " end))
(->IntInclusiveDiscreteValueRange start end))
(def int-range-inclusive (memoize int-range-inclusive*))
(defmethod range/->discrete-value-range :int-range-inclusive [_ start end]
(int-range-inclusive start end))