tkobayas commented on PR #6469:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6469#issuecomment-3345481105

   Thank you for the PR, @DimaSol 
   
   As you see in the failed test cases, there are some things to consider.
   
   A) `MvelOperatorsTest.testMatchesWithFunction` : Dynamic operand like `name 
matches addStar(likes)` results in `regexp_failed_to_parse`. I think the 
"static regex pattern" approach is applicable only to non dynamic oprand 
(literal String). For dynamic cases, we still need `MatchesOperator`...?
   
   B) `MvelOperatorsTest.testMatchesOnNullString` etc. : Negative hash results 
in compilation error. It could be resolved by 
`Integer.toUnsignedString(s.hashCode())`
   
   Probably some more, but solving the above 2 points would help us to see 
other issues clearer.
   
   ----
   
   Btw, before going into that deep, how about just changing from 
`Collections.synchronizedMap` to `ConcurrentHashMap` in `MatchesOperator`?
   
   `ConcurrentHashMap` doesn't block concurrent `get`, it's match faster than 
`Collections.synchronizedMap` in the concurrent read use case.
   
   ```
   Benchmark                                 (_factsNumber)  (_rulesNumber)  
(cacheEnabled)  Mode  Cnt  Score   Error  Units
   MatchesOperatorMultiThreadBenchmark.test             256               8     
       true    ss  100  0.523 ± 0.096  ms/op
   MatchesOperatorMultiThreadBenchmark.test             256               8     
      false    ss  100  1.032 ± 0.157  ms/op
   ```
   
   If it also works for your rules, I think this is a better (easy) option. 
WDYT?


-- 
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