Drools Performance Tests

天涯浪子 提交于 2020-03-02 23:02:06

问题


Currently we are looking to use drools in a system for managing knowledge intensive processes.

To the best of my knowledge information about and results of performance tests done for drools are scarce and hard to find.

While use cases differ widely, it would be good to know common bottlenecks (the inserts are one, for example) and possible best practices to get around them for certain scenarios. Also, knowing more about the performance in general could help evaluating if Drools is a viable solution to the problems at hand.

Is there any information about for example performance metrics and performance tests for drools made available?


回答1:


The only pitfall I found fundamental while working with drools is about when block authoring. Don't use computations in when blocks. This is what drools says even about getters!:

Person( age == 50 )

// this is the same as:
Person( getAge() == 50 )

Note
We recommend using property access (age) over using getters explicitly (getAge()) because of performance enhancements through field indexing. (source)

Then block by default is executed by the same (single) thread. This is now your professionalism to make it efficient. Use asynchronous processing (@Anync in Spring), thread pool, java parallel streams etc.
You can use jvisualvm to profile the run where rules will be listed as ordinal java method calls and you can use any other tools to analyse bottlenecks in your code, like this library for tests and live environments.



来源:https://stackoverflow.com/questions/44925752/drools-performance-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!