paulirwin opened a new issue, #1006:
URL: https://github.com/apache/lucenenet/issues/1006

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Task description
   
   There are various places throughout the codebase where we are using the 
`TripleShift` extension method from J2N to perform an unsigned right shift, 
since older versions of C# did not have this operator. C# 11 added the `>>>` 
operator like Java has to do this, which gets translated directly to the 
`shr.un` opcode, so should be more efficient than the several opcodes involved 
in the various TripleShift overloads, even if it is aggressively inlined. In 
addition, it will help make direct porting from Java easier.
   
   (Note: the aggressive inlining doesn't seem to be working in our published 
NuGet packages, as spot checking one example in BaseCharFilter still had a 
`call` operation to TripleShift, which is certainly going to be worse for 
performance than a single opcode.)
   
   I have confirmed this works on net462, our oldest target, with LangVersion 
set to 11, for all overloads that TripleShift supports.
   
   Need to confirm that setting our LangVersion to 11 does not cause 
regressions elsewhere.


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

Reply via email to