mdproctor opened a new issue, #6729:
URL: https://github.com/apache/incubator-kie-drools/issues/6729

   ## Context
   Hot-path code in vol2 uses `instanceof PropagatingDataStore` to dispatch on 
DataSource type. instanceof checks have virtual dispatch cost and prevent the 
JIT from fully optimising tight loops.
   
   ## Required design
   Each `DataSource` implementation carries an `int type()` discriminant. 
Dispatch becomes:
   ```java
   switch (ds.type()) {
       case DataSourceTypes.PROPAGATING -> { PropagatingDataStore<?> pds = 
(PropagatingDataStore<?>) ds; ... }
       default -> throw new UnsupportedOperationException("DataSource type not 
yet supported: " + ds.getClass());
   }
   ```
   
   The explicit UnsupportedOperationException surfaces any TBD paths 
immediately rather than silently ignoring them.
   
   ## Interim state
   Until this is implemented, all instanceof checks should have a corresponding 
`else { throw new UnsupportedOperationException("DataSource type not yet 
supported: " + ds.getClass()); }` guard so unknown types don't silently no-op.
   
   Refs #6724


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