Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce amount of generated code when deriving Configs in Scala 3 #1480

Open
wants to merge 2 commits into
base: series/4.x
Choose a base branch
from

Conversation

kyri-petrou
Copy link
Contributor

While working on a previous issue, I realised that the derivation of DeriveConfig was generating a lot of unnecessary bytecode in Scala 3. This PR reduces it substantially by:

  1. Using val instead of lazy val within inlined methods
  2. Putting transformations within non-inlined methods to avoid generating the same FunctionX whenever we derive a new DeriveConfig
  3. Using @threadUnsafe whenever we need to use a lazy val but don't plan to access it concurrently by multiple threads

@kyri-petrou kyri-petrou requested a review from a team as a code owner November 7, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant