Bug 980981
| Summary: | Evaluating simple rules with temp. operators takes much longer comparing to 5.3.1-P03 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Petr Široký <psiroky> | ||||||
| Component: | BRE | Assignee: | Mario Fusco <mfusco> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Petr Široký <psiroky> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 6.0.0 | CC: | mfusco, mproctor, rzhang | ||||||
| Target Milestone: | ER2 | ||||||||
| Target Release: | 6.0.0 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-08-06 20:17:11 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Petr Široký
2013-07-03 18:02:29 UTC
Created attachment 768370 [details]
Simple Maven based reproducer
KSession was slower in beta4, because of segment initialization is heavy. Mario has "proto" classed that initialization now, so after the first ksession, they should be quick to create. The problem was not caused by phreak (that indeed is faster than rete), but by the fact that the default event processing mode has been mistakenly set to STREAM instead of CLOUD, so that test was running in STREAM mode on beta4. I fixed this. So, should be the difference between running in CLOUD and STREAM mode that high? 20ms vs 3000ms? This seems not right to me. I will test it with 5.3.x to see if the difference is also there. I ran the test with 5.3.1-P03 and the difference between CLOUD and STREAM mode is negligible. So the main problem is that the difference between these two processing options in Drools 6 is very high. I will also update the reproducer to include the code for running with 5.3.1.-P03. Created attachment 768725 [details]
Reproducer including both Drools5 and Drools6 projects.
Added Maven reproducer that includes code for both Drools 5 and Drools 6.
To run with CLOUD option, just use "mvn test", for running in STREAM mode use "mvn test -Ddrools.mode=stream".
I profiled the provided test case in STREAM mode and found that the culprit of this huge difference were 2 trace logging statements not guarded by a
if ( log.isTraceEnabled() ) { ... }
block. I conditioned those log statements in that way (together with some other I found doing a full text search) and now phreak is slightly faster than rete even in STREAM mode.
By the way I also added the possibility to pass a varargs of KieBaseOptions to the KieHelper when building the KieBase so, for example, now you can do: kieBase = kieHelper.build(PhreakOption.ENABLED, EventProcessingOption.STREAM); Thanks for the quick fix Mario! Will retest asap. And btw thanks for adding the possibility to configure KieBase when using KieHelper, this is really useful. Verified fixed on 6.0.0 master. I will close this bz once verified also in product build. Verified fixed in ER2. |