You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "mdedetrich (via GitHub)" <gi...@apache.org> on 2024/01/22 02:20:27 UTC
[PR] Use lazy val's in sbt build [incubator-pekko]
mdedetrich opened a new pull request, #1016:
URL: https://github.com/apache/incubator-pekko/pull/1016
This PR updates the sbt build so it uses `lazy val`'s in the areas where its idiomatic/expected to do so that the code is both easier to understand and in some cases faster (i.e. avoiding unnecessary re-evaluation or not evaluating values if they aren't needed) specifically
* zero arg `def`'s. There is no reason to use a `def`'s here because computed values will not change in consecutive evaluations so the behaviour of `lazy val` caching the value after first evaluation is what we want here.
* `val`'s: Any val's which use the sbt dsl/syntax have been changed to `lazy val` because they expensive to compute for the first time so this means that we only actually compute the values if needed. `val`'s that only initiate constants (i.e. string constants) that don't use the sbt dsl have been untouched because evaluating those is likely as fast (if not faster) than the overhead that `lazy val` has
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Use lazy val's in sbt build [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on PR #1016:
URL: https://github.com/apache/incubator-pekko/pull/1016#issuecomment-1903317288
@mdedetrich Would you merge this soon, then we next build will be faster.
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Use lazy val's in sbt build [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1016:
URL: https://github.com/apache/incubator-pekko/pull/1016#discussion_r1461370936
##########
project/ParadoxBrowse.scala:
##########
@@ -19,12 +19,12 @@ import sbt._
object ParadoxBrowse extends AutoPlugin {
object autoImport {
- val paradoxBrowse = taskKey[Unit]("Open the docs in the default browser")
+ lazy val paradoxBrowse = taskKey[Unit]("Open the docs in the default browser")
Review Comment:
I think this kind should not be a `lazy val`.
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Use lazy val's in sbt build [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #1016:
URL: https://github.com/apache/incubator-pekko/pull/1016
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] Use lazy val's in sbt build [incubator-pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #1016:
URL: https://github.com/apache/incubator-pekko/pull/1016#discussion_r1461370936
##########
project/ParadoxBrowse.scala:
##########
@@ -19,12 +19,12 @@ import sbt._
object ParadoxBrowse extends AutoPlugin {
object autoImport {
- val paradoxBrowse = taskKey[Unit]("Open the docs in the default browser")
+ lazy val paradoxBrowse = taskKey[Unit]("Open the docs in the default browser")
Review Comment:
I think this kind should not be a `lazy val`.
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org