clara

http://www.clara-rules.org/
nlessa 2018-11-14T13:40:05.129100Z

Hi, I am having performance problems in my set of rules. Probably some of the rules are performing bad. Is there any way to profile the time spent by each rule when firing-rules in a session? I couldn't find any obvious way to get this info using the inspect api.

2018-11-14T14:17:36.132800Z

The inspect api is targeted at understanding the end result of the rules, not performance. For performance problems you’ll probably want a profiler or perhaps tracing. Tracing shows all the internal steps of the rules engine, and can produce a lot of data that is probably best sorted through with the REPL rather than manual inspection, but if a single rule is constantly re-firing it can make that clear. I’d probably start with a profiler though. Another approach could be to take separate parts of your use-case and see if you can find a simple subset with the perf problem, particularly one you can share that would be easier for someone else to look at.

2018-11-14T14:17:58.133200Z

Are you on Clojure or ClojureScript?

nlessa 2018-11-14T14:20:25.133800Z

Thanks, @wparker! Clojure.

2018-11-14T16:40:21.135700Z

@nlessa and feel free to share profiler sample results with me (or anyone interested) (with anything propriety removes). Sometimes just seeing the Clara internals in a profiling snapshot can help point someone in the right direction. Not always though.

👍 3