You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "sabi0 (via GitHub)" <gi...@apache.org> on 2024/01/29 15:09:38 UTC

[PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

sabi0 opened a new pull request, #13048:
URL: https://github.com/apache/lucene/pull/13048

   ### Description
   
   <!--
   If this is your first contribution to Lucene, please make sure you have reviewed the contribution guide.
   https://github.com/apache/lucene/blob/main/CONTRIBUTING.md
   -->
   


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on PR #13048:
URL: https://github.com/apache/lucene/pull/13048#issuecomment-1915656350

   I hope I understood your suggestions with CHANGES.txt right. Please let me know if I should change something there.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on code in PR #13048:
URL: https://github.com/apache/lucene/pull/13048#discussion_r1470080459


##########
lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java:
##########
@@ -185,7 +185,7 @@ static VectorizationProvider lookup(boolean testMode) {
    */
   private static Optional<Module> lookupVectorModule() {
     return Optional.ofNullable(VectorizationProvider.class.getModule().getLayer())
-        .orElse(ModuleLayer.boot())

Review Comment:
   Thank you for the insightful comments.
   I will remove the unwanted changes.



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13048:
URL: https://github.com/apache/lucene/pull/13048#issuecomment-1915682882

   Looks fine. Have you added all PR numbers that were merged today and the ones I approved already?  I will merge them soon.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13048:
URL: https://github.com/apache/lucene/pull/13048#issuecomment-1915203166

   For your cleanup pull requests to be merged, please make sure to add a description to your issue, why those changes are useful.
   
   I agree to merge this (any some of your other PRs), but before doing that we would like to have a changes entry including your full name to give you credit.
   
   Uwe


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on code in PR #13048:
URL: https://github.com/apache/lucene/pull/13048#discussion_r1469932148


##########
lucene/core/src/java/org/apache/lucene/internal/vectorization/VectorizationProvider.java:
##########
@@ -185,7 +185,7 @@ static VectorizationProvider lookup(boolean testMode) {
    */
   private static Optional<Module> lookupVectorModule() {
     return Optional.ofNullable(VectorizationProvider.class.getModule().getLayer())
-        .orElse(ModuleLayer.boot())

Review Comment:
   This change is not necessary. The boot layer is a static constant in system class.



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "sabi0 (via GitHub)" <gi...@apache.org>.
sabi0 commented on PR #13048:
URL: https://github.com/apache/lucene/pull/13048#issuecomment-1915392997

   I've added my name to the GitHub profile. And will review the PRs to describe the reasoning.
   
   -Dmitry


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13048:
URL: https://github.com/apache/lucene/pull/13048#issuecomment-1915623346

   It would be nice to have a changes entry in `CHANGES.txt`. You can add it to 9.10 section and I will cherry pick the changes in Lucene 9.x.
   
   As you have more open PRs with cleanups, it would be good to have a generic one and we lost all your PR numbers there.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Use orElseGet() to avoid unnecessary object allocation [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler merged PR #13048:
URL: https://github.com/apache/lucene/pull/13048


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org