This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-06
Channels
- # bangalore-clj (16)
- # beginners (120)
- # boot (21)
- # cider (24)
- # clara (9)
- # cljs-experience (1)
- # cljsrn (1)
- # clojure (218)
- # clojure-dev (3)
- # clojure-italy (12)
- # clojure-losangeles (4)
- # clojure-norway (2)
- # clojure-russia (2)
- # clojure-spec (19)
- # clojure-uk (178)
- # clojurescript (52)
- # cursive (7)
- # data-science (55)
- # datomic (25)
- # defnpodcast (11)
- # emacs (5)
- # fulcro (27)
- # hoplon (2)
- # leiningen (14)
- # midje (9)
- # off-topic (132)
- # onyx (19)
- # other-languages (23)
- # portkey (2)
- # re-frame (31)
- # reagent (1)
- # ring-swagger (15)
- # shadow-cljs (58)
- # slack-help (13)
- # spacemacs (22)
- # sql (7)
- # test-check (13)
Can you put a time
on each rule?
Or a route to view the profile/debug the rules?
There is something slow in my engine but I'm not sure how to find what it is.
maybe run your engine under a profiler like VisualVM? can see what methods may be using the most time and go from there?
If the problem is a function in your rules (RHS, accumulator function, etc.) that’s taking a lot of time then something like VisualVM would likely be helpful. That’s where I’d start. If the problem is that the rules are firing in a bad/suboptimal way then Clara’s tracing could provide some info, but that is harder to use. https://github.com/cerner/clara-rules/blob/master/src/main/clojure/clara/tools/tracing.cljc, the discussion on https://github.com/cerner/clara-rules/issues/344 around potential tracing enhancements could give some insight into how it works as well
@wparker I made a macro that wrap rhs
inside a time
-like macro, that time RHS and store it's time on a global atom (just for use on repl).
It allow's me to see how many times each rule is fired, how many time each "burn" takes, avg, "total time" from each rule. Simple and usefull 😄
Glad you’ve found a working solution @souenzzo FYI, there are some cases where Clara could repeatedly add a rule to the queue of things waiting to be fired, remove it, add it again, etc. without ever actually firing it (and thus avoiding that macro) but my guess is those cases are a small though nontrivial minority of perf problems