zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
787 stars 396 forks source link

Revise usages of `lazy val`s #3051

Closed kyri-petrou closed 1 month ago

kyri-petrou commented 1 month ago

There are a quite a few places where we use lazy val unnecessarily. Lazy vals come with a small overhead so we should use them only for cases that we either absolutely have to (e.g., recursive methods) or when:

  1. A method is computationally expensive. If it's cheap we should use def instead
  2. The method might be called, and if called it'll be called 2+ times. If we're certain the method will be called we should use val instead.
jdegoes commented 1 month ago

/bounty $175

algora-pbc[bot] commented 1 month ago

💎 $175 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #3051 with your implementation plan
  2. Submit work: Create a pull request including /claim #3051 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @987Nabil Aug 28, 2024, 5:38:48 AM #3067
987Nabil commented 1 month ago

/attempt #3051

Algora profile Completed bounties Tech Active attempts Options
@987Nabil    77 ZIO bounties
+ 1 bounty from 1 project
Scala
Cancel attempt
algora-pbc[bot] commented 1 month ago

💡 @987Nabil submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 1 month ago

🎉🎈 @987Nabil has been awarded $175! 🎈🎊