                       (fn [set tuple]
                         (conj! set (getter tuple))))
                (persistent!)))))
-    (collect context syms)))
+    (collect-to context syms (fast-set) [(map vec)])))
 
 
 (defn subtract-from-rel [rel syms exclude-key-set]

            result))))))


(defn collect [context syms]
  (perf/measure
    (if (:empty? context)
      (fast-set)
      (let [syms-indexed (vec (shim/zip syms (range)))
            specimen     (shim/make-array (count syms))
            _            (collect-consts syms-indexed specimen (:consts context))
            related-rels (related-rels context syms)
            xfs          (-> (map #(collect-rel-xf syms-indexed %) related-rels)
                             (concat [(map vec)]))]
        (into (fast-set) (apply comp xfs) [specimen])))
   "collect"))


;; Query

(def query-cache (volatile! (datascript.lru/lru lru-cache-size)))


                     "resolve-clauses")
          syms     (concat (dp/find-vars (:find parsed-q))
                           (map :symbol (:with parsed-q)))]
      (native-coll (collect-to context syms (fast-set) [(map vec)])))
    "Query" q))


