You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/03 10:06:14 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Technoboy- opened a new pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542


   ### Motivation
   Use orElseGet when is not a raw value, otherwise it will calling the orElse every time.
   
   ### Documentation
   This is an enhancement, no need to update doc.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui merged pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542


   


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] codelipenghui merged pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542


   


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] eolivelli commented on pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542#issuecomment-891771325


   The patch looks good.
   
   I am not sure we achieve some visible improvement because in anyway you are allocating an instance of the lambda expression. Probably the overhead of instantiating such instance will be lower.
   
   I am +1 


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] Technoboy- commented on pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542#issuecomment-891754723


   /pulsarbot run-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] eolivelli commented on pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542#issuecomment-892029194


   I am not sure if it really happens.
   I would be curious to verify if it really the JVM does it.
   But I not time to dig into it


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar] merlimat commented on pull request #11542: Replace orElse with orElseGet to avoid calling too many times.

Posted by GitBox <gi...@apache.org>.
merlimat commented on pull request #11542:
URL: https://github.com/apache/pulsar/pull/11542#issuecomment-892023406


   > I am not sure we achieve some visible improvement because in anyway you are allocating an instance of the lambda expression. Probably the overhead of instantiating such instance will be lower.
   
   If the lambda is not capturing any reference, like `TopicPolicies::new` it will not need an allocation.


-- 
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: commits-unsubscribe@pulsar.apache.org

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