This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-07
Channels
- # announcements (7)
- # asami (3)
- # aws-lambda (2)
- # babashka (10)
- # beginners (30)
- # bristol-clojurians (3)
- # calva (13)
- # cider (26)
- # clj-kondo (6)
- # clojure (172)
- # clojure-europe (30)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-serbia (9)
- # clojure-uk (64)
- # clojurescript (76)
- # conjure (9)
- # cursive (46)
- # data-science (1)
- # datomic (6)
- # emacs (13)
- # etaoin (1)
- # fulcro (27)
- # girouette (4)
- # jobs (1)
- # joker (2)
- # lsp (7)
- # malli (19)
- # meander (47)
- # off-topic (123)
- # pathom (6)
- # reitit (3)
- # remote-jobs (7)
- # reveal (37)
- # ring-swagger (2)
- # shadow-cljs (60)
- # specter (5)
- # startup-in-a-month (3)
- # tools-deps (21)
- # vim (4)
@nathanmarz: thanks, I rewrote it as follows:
(s/select [s/ALL :systems s/ALL :containers s/ALL
(s/transformed [(s/collect-one :name) :dependencies s/ALL]
(fn [c d]
{:container c
:dependency (:name d)
:transports (:transport d)
:entities (:data_entity d '())}))
:dependencies s/ALL]
yaml-data)
This works correctly, but is still slower on criterium benchmarks (129.3 us for ->>
version, 129.9 for same code with transduce
instead of ->>
, 193.7 us for this form above, 307.7 us for my previous select + transform + select
version.I’ll continue to play some more with specter in this project, thank you for the work you’ve put into it and for releasing it to all of us!
@h0bbit i would guess value collection is the source of the slowdown, as it causes the transform fn to be run with apply
rather than a direct invoke
for top-level transforms there's vtransform
to avoid that
would be pretty easy to make a vtransformed
to accomplish the same thing for your use case