Open pchampin opened 6 months ago
NB:
Any
would still returnNoHint
, and that's OK, because callingAny::match
, which is implemented as{ return true }
, will be optimized away anyway.
Rectification: Graph::triples_matching
implementations will generally not need a specific hint for Any
but implementations of MutableGraph::remove_matching
and MutableGraph::retain_matching
could benefit from such a hint.
This issue emerged from #153 .
The method
TermMatcher::constant
offers implementers a way to optimize their processing ofTermMatcher
s: instead of naively generating all triples and filtering them usingTermMatcher::matches
, they can use the constant term to only generate the necessary triples.This is very well for some implementations, but it makes it impossible to optimize on more complex matchers, which some implementations could do. It might be interesting to extend
TermMatcher::constant
into a more complex method(call itoptimizationHint
for example), which would return an enum as suggested below. Different implementations would be able to take advantage of different kinds of hints...Proposal:
NB:
Any
would still returnNoHint
, and that's OK, because callingAny::match
, which is implemented as{ return true }
, will be optimized away anyway.