tkobayas commented on issue #6309:
URL: 
https://github.com/apache/incubator-kie-drools/issues/6309#issuecomment-2820083423

   > 1. the lazy loading of units. I see now it is all loaded at ones. And not 
at startup time but on the first fire. If we have many rules and files that 
might make the first call very long. And suppose we are running many instances 
on K8s. The pods can come in and out so that would happen too often.
   
   In `createRuleUnitInstance` (not `fire`), rules are loaded and compiled. If 
you want to avoid the "long first call", you can call `createRuleUnitInstance` 
at the early stage (e.g. startup) and just close the instance so the compiled 
resources are internally cached and the next `createRuleUnitInstance` will be 
fast.
   
   ```
           try ( RuleUnitInstance<HelloWorldUnit> unitInstance = 
RuleUnitProvider.get().createRuleUnitInstance(unit) ) {
               // no op
           }
   ```
   
   > 2. Build the rule units on compile time and load the compiled drl data so 
we will not spend run time for to build it on every instance?
   
   Indeed, that's Kogito is for. Have you tried?
   
   https://kie.apache.org/docs/10.0.x/kogito/
   
https://github.com/apache/incubator-kie-kogito-examples/tree/10.0.x/kogito-springboot-examples/ruleunit-springboot-example
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to