tkobayas commented on issue #6462: URL: https://github.com/apache/incubator-kie-drools/issues/6462#issuecomment-3327114349
Thank you for reporting, @DimaSol I confirmed that the `Collections$SynchronizedMap.get()` bottle-neck is not negligible. My test) https://github.com/tkobayas/kie-benchmarks/blob/matches-operator-multi-thread/drools-benchmarks-parent/drools-benchmarks-quick/src/main/java/org/drools/benchmarks/quick/MatchesOperatorMultiThreadBenchmark.java ``` Benchmark (_factsNumber) (_rulesNumber) (cacheEnabled) Mode Cnt Score Error Units MatchesOperatorMultiThreadBenchmark.test 256 8 true ss 100 1.842 ± 0.472 ms/op MatchesOperatorMultiThreadBenchmark.test 256 8 false ss 100 1.241 ± 0.227 ms/o ``` async-profiler wall-clock <img width="1896" height="662" alt="Image" src="https://github.com/user-attachments/assets/c3bea5ba-e030-4240-8992-f315e703362a" /> zoomed <img width="1892" height="417" alt="Image" src="https://github.com/user-attachments/assets/4bb77320-2f88-4da8-b1aa-76ae81896d23" /> > Would it be possible for the regex pattern to be embedded directly in the precompiled Java predicate as a member field? This would avoid cache contention and improve performance in concurrent scenarios. It sounds like a good idea. @mariofusco WDYT? > I’d be happy to contribute code for this enhancement if someone can provide guidance on where to make the changes (e.g., in the compiler or the Maven KJAR plugin). It's great to hear that you are willing to contribute! Predicate generation is done around these methods: `AbstractExpressionBuilder.buildConstraintExpression` -> `DrlxParseUtil.generateLambdaWithoutParameters` : the constraint lambda generation `ExecModelLambdaPostProcessor.replaceLambda` : generate Predicate class from the lambda If you implement that, it will be also available in KJAR plugin. I'm not sure how difficult the implementation will be. Feel free to let us know if you face any difficulty. Thanks! -- 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]
