This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-01
Channels
- # aleph (7)
- # bangalore-clj (1)
- # beginners (89)
- # boot (5)
- # clara (21)
- # cljs-dev (2)
- # cljsrn (57)
- # clojure (58)
- # clojure-austin (1)
- # clojure-conj (1)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-russia (4)
- # clojure-sanfrancisco (4)
- # clojure-spec (31)
- # clojure-uk (67)
- # clojurebridge (4)
- # clojurescript (56)
- # cursive (92)
- # data-science (4)
- # datomic (15)
- # emacs (23)
- # events (1)
- # fulcro (121)
- # gorilla (2)
- # jobs-discuss (1)
- # juxt (1)
- # lambdaisland (6)
- # lumo (13)
- # off-topic (11)
- # om (1)
- # onyx (17)
- # overtone (5)
- # parinfer (9)
- # planck (3)
- # re-frame (21)
- # reagent (95)
- # ring-swagger (7)
- # spacemacs (58)
- # vim (13)
- # yada (2)
Well, I know Drools (popular Java-based rules engine)(prior to v6) used to have a good amount of performance issues around accumulators.
Later on, a lot of laziness was added to Drools, but even more importantly (in my opinion) “batched” propagations of facts and it mostly solved the common issues around performance that came up.
Clara has “batched” propagation of facts, which seems to typically work out well. The engine basically “gathers” up collections of facts at a time that are matching conditions before propagating down the network. This results in typically less churn/rework as the data flows.
Just pointing that out if the question of salience was more about performance than ordering semantics
I'm not sure if this is directly tied to clara, but I am noticing a severe processing time drop the first time I run a rules session with a specific namespace. So for example, (-> (r/mk-session 'some.ns) (r/insert ..) .. (r/fire-rules))
takes 1000ms the first time it is called, but 50ms the second time. Is there some way I can reduce that first performance hit?
I know I need to profile the app to be sure what's going on, just darn jprofiler is too expensive >.<
You’ll still take the hit though. Just maybe you could move the hit out of the processing where it is more painful.
awesome thank you, that will solve my issues (and thanks for the nudge at visualvm, looks good too!)
@mikerod if I different collections of ns (i.e., (r/mk-session 'ns.a 'ns.b 'ns.c)
vs (r/mk-session 'ns.d 'ns.e 'ns.f)
can I pre-cache individual namespaces e.g. (r/mk-session 'ns.a)
? Or would I have to pre-cache full collections (r/mk-session 'ns.a 'ns.b 'ns.c)
? Basically, can I init each individually, if they are used in collections? Or will it only cache on the full collection.
@dadair glad you can work with that. Building the rulebase graph can be a fairly expensive operation. It could perhaps be further optimized in Clara, but there are tricky aspects.
For one, there is some eval
going on, which means it is running the clj compiler and I often see that time dominate for larger rulebase’s
(terminology things: the “rulebase” term just means the underlying “statess” Rete-based graph that is wired together with working memory within the “session”)