You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "paulirwin (via GitHub)" <gi...@apache.org> on 2024/11/02 14:54:34 UTC
[I] Replace J2N.Numerics.BitOperation.TripleShift with >>> in C# 11 [lucenenet]
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: dev-unsubscribe@lucenenet.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace J2N.Numerics.BitOperation.TripleShift with >>> in C# 11 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin commented on issue #1006:
URL: https://github.com/apache/lucenenet/issues/1006#issuecomment-2453466038
Cool, thanks. I can take those
--
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: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace J2N.Numerics.BitOperation.TripleShift with >>> in C# 11 [lucenenet]
Posted by "NightOwl888 (via GitHub)" <gi...@apache.org>.
NightOwl888 commented on issue #1006:
URL: https://github.com/apache/lucenenet/issues/1006#issuecomment-2453372765
I have added this task to the other projects we own where it applies:
https://github.com/NightOwl888/J2N/issues/115
https://github.com/NightOwl888/ICU4N/issues/92
https://github.com/NightOwl888/Morfologik.Stemming/issues/1
https://github.com/NightOwl888/RandomizedTesting/issues/5
--
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: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Replace J2N.Numerics.BitOperation.TripleShift with >>> in C# 11 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin closed issue #1006: Replace J2N.Numerics.BitOperation.TripleShift with >>> in C# 11
URL: https://github.com/apache/lucenenet/issues/1006
--
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: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org