   (let [products (mapv prepare-product (load-input (:products-uri conf)))]
     (with-open [listings (io/reader (:listings-uri conf))
                 out (io/writer (:out-uri conf))]
-      (doseq [result (->> (line-seq listings)
-                          (map parse-json)
-                          (map #(match-product products %)))]
-        (json/generate-stream result out)))))
+      (doseq [item (->> (line-seq listings)
+                        (map parse-json)
+                        (domatch products))]
+        (json/generate-stream item out)
+        (.write out "\n")))))

    (when-let [[_ match] (match-title products listing')]
      [listing match])))

(defn domatch [products listings]
  (let [matches (->> listings
                     (pmap #(match products %))  ; pmap was a 4x speedup
                     (filter some?))]

                 :listings (map first matching-listings)})))))



(defn test-random [products listings]
  ((juxt #(match products %) identity)
   (rand-nth listings)))



(defn -main
  [& args]
  ; We need to read all products into memory, but we
