More investigation into perf issues

This commit is contained in:
2023-03-13 08:30:56 -07:00
parent 0f18ad6778
commit 67eb52768f

View File

@@ -302,23 +302,30 @@
used-vendor-names)
(d/pull-many (d/db conn) [:db/id :vendor/name])
(by :vendor/name)))
all-clients (by :client/code (d-clients/get-all ))
all-client-bank-accounts (reduce
(fn [acc client]
(assoc acc (:client/code client)
(set (->> (:client/bank-accounts client)
(map :bank-account/code)
))))
{}
(d-clients/get-all))
all-client-locations (reduce
(fn [acc client]
(assoc acc (:client/code client)
(-> (set (:client/locations client))
(conj "HQ")
(conj "A"))))
{}
(d-clients/get-all))
all-clients (mu/trace ::get-all-clients []
(by :client/code (d-clients/get-all )))
all-client-bank-accounts (mu/trace ::get-all-client-bank-accounts
[]
(reduce
(fn [acc client]
(assoc acc (:client/code client)
(set (->> (:client/bank-accounts client)
(map :bank-account/code)
))))
{}
(d-clients/get-all)))
all-client-locations (mu/trace ::get-all-client-locations
[]
(reduce
(fn [acc client]
(assoc acc (:client/code client)
(-> (set (:client/locations client))
(conj "HQ")
(conj "A"))))
{}
(d-clients/get-all)))
new-hidden-vendors (reduce
(fn [new-vendors {:keys [vendor_name]}]
(if (or (all-vendors vendor_name)
@@ -340,7 +347,8 @@
used-vendor-names)
(d/pull-many (d/db conn) [:db/id :vendor/name])
(by :vendor/name))
all-accounts (transduce (map (comp str :account/numeric-code)) conj #{} (a/get-accounts))
all-accounts (mu/trace ::get-all-accounts []
(transduce (map (comp str :account/numeric-code)) conj #{} (a/get-accounts)))
transaction (mu/trace ::build-transaction
[:count (count (:entries args))]
(doall (map