salvatorecampagna commented on PR #16282: URL: https://github.com/apache/lucene/pull/16282#issuecomment-4786461456
> This PR will prevent the function from being inlined anymore (I do not know if it is important). Previously it would work with bimorphic inlining. I think you're referring to `bits.get(i)` in the generic fallback loop (that's the only virtual dispatch I see, am I missing anything else?). Before this PR, `SparseLiveDocs` and `DenseLiveDocs` both fell through to that loop, so the JIT saw exactly 2 receiver types at that call site and could apply bimorphic inlining for both `get()` implementations. After this PR those two types take the fast paths and never reach the loop, so that call site loses its 2-type profile, right? The `instanceof` chain itself does not introduce megamorphic dispatch since after each type guard the type is statically known at that point. As a result, the trade-off being made is: an `O(maxDoc)` loop with bimorphic virtual `get()` calls is replaced by `O(maxDoc/64)` direct word operations with no virtual dispatch. Is that the concern you had in mind? -- 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]
